def find_images(url):

    images = set()

    # Fetch the content.
    headers = {
        'User-Agent': ('Mozilla/5.0 (compatible; OrchestraBot/1.0; '
                       'noreply@example.org)'),
    }
    response = requests.get(url, headers=headers)
    if response.status_code < 200 or response.status_code >= 300:
        logger.error("Couldn't fetch url {}".format(url))
        return images
    content = response.text

    # Find images in the content.
    soup = BeautifulSoup(content)
    tags = soup.find_all('img', src=IMAGE_FILE_REGEX)
    for tag in tags:
        link = tag.get('src')
        if link is None:
            continue
        if not bool(urlparse(link).netloc):
            link = urljoin(url, link)
        images.add(link)
    return images
Fetches a url's HTML and extracts all image sources in an <img> tag.
dataset/ETHPy150Open unlimitedlabs/orchestra/simple_workflow/v1/crawl.py/find_images