def _extract_links(self, response_text, response_url, response_encoding, base_url=None):
        self.reset()
        self.feed(response_text)
        self.close()

        ret = []
        if base_url is None:
            base_url = urljoin(response_url, self.base_url) if self.base_url else response_url
        for link in self.links:
            if isinstance(link.url, unicode):
                link.url = link.url.encode(response_encoding)
            link.url = urljoin(base_url, link.url)
            link.url = safe_url_string(link.url, response_encoding)
            link.text = str_to_unicode(link.text, response_encoding, errors='replace').strip()
            ret.append(link)

        return ret
Do the real extraction work
dataset/ETHPy150Open wcong/ants/ants/contrib/linkextractors/sgml.py/BaseSgmlLinkExtractor._extract_links