'Do the real extraction work'

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, six.text_type):
            link.url = link.url.encode(response_encoding)
        try:
            link.url = urljoin(base_url, link.url)
        except ValueError:
            continue
        link.url = safe_url_string(link.url, response_encoding)
        link.text = to_unicode(link.text, response_encoding, errors='replace').strip()
        ret.append(link)
    return ret
