def _extract(elt, doc):
    if 'itemtype' in elt.attrib or 'itemscope' in elt.attrib:
        return MicrodataObject(elt, doc)
    tag = elt.tag
    if tag == 'a' and 'href' in elt.attrib:
        href = elt.attrib['href']
        if href.startswith('#'):
            target = doc._doc.getroot().find(".//*[@id='%s']" % href[1:])
            if target is not None: return _extract(target, doc)
        else:
            up = urlparse.urlparse(href)
            remote_doc = enter(urlparse.urlunparse((up.scheme, up.netloc, up.path, up.params, up.query, '')))
            if up.fragment:
                target = remote_doc._doc.getroot().find(".//*[@id='%s']" % up.fragment)
                if target is not None: return _extract(target, remote_doc)
            if len(remote_doc.objects) == 1: return remote_doc.objects[0]
            return _extract(remote_doc._doc.getroot(), remote_doc)
    if tag == 'img': return elt.attrib['src']
    return _extract_text(elt)
This function takes a given DOM node 'elt' and attempts to interpret
dataset/ETHPy150Open Comcast/htmlapi-client-python/htmlapi_client.py/_extract