You can download this code by clicking the button below.
This code is now available for download.
This function takes an HTML string as input, then uses the PyQuery library to parse the HTML, find all `<img>` tags, and return a list of `src` attributes from these tags.
Technology Stack : Python, PyQuery
Code Type : Python Function
Code Difficulty : Intermediate
def find_images_in_html(html):
from pyquery import PyQuery as pq
pq_html = pq(html)
images = pq_html('img').items()
return [img.attr('src') for img in images]