Returns a list of tuples in the form (url, file_name, line_number)

def parse_html_urls(file_name, html_data):
    '''
    Returns a list of tuples in the form (url, file_name, line_number)
    '''
    try:
        html = lxml.html.fromstring(html_data)
        anchor_tags = html.cssselect('a')

        for a in anchor_tags:
            # A link was started but not finished, href with nothing set!
            if not 'href' in a.attrib or a.attrib['href'] == '':
                BROKEN_URLS.append(('None', file_name, a.sourceline))

            url = clean_url(a.attrib['href'])

            if is_valid_url(url):
                if url not in URL_CACHE:
                    URL_CACHE.add(url)

                    yield (url, file_name, a.sourceline)

    except SyntaxError:
        pass