def find_images(url):
    " Fetches a url's HTML and extracts all image sources in an <img> tag.\n    "
    images = set()
    headers = {'User-Agent': 'Mozilla/5.0 (compatible; OrchestraBot/1.0; example@example.com)'}
    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
    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.
def find_images(url):
    " \n    "
    images = set()
    headers = {'User-Agent': 'Mozilla/5.0 (compatible; OrchestraBot/1.0; example@example.com)'}
    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
    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