(self)
Yields all links in the page
Yields all links in the page
Yields all links in the page
def iter_links(self):
        # type: () -> Iterable[Link]
        """Yields all links in the page"""
        document = html5lib.parse(
            self.content,
            transport_encoding=_get_encoding_from_headers(self.headers),
            namespaceHTMLElements=False,
        )
        base_url = _determine_base_url(document, self.url)
        for anchor in document.findall(".//a"):
            link = _create_link_from_element(
                anchor,
                page_url=self.url,
                base_url=base_url,
            )
            if link is None:
                continue
            yield link
def iter_links ( self ) : # type: () -> Iterable[Link] document = html5lib . parse ( self . content , transport_encoding = _get_encoding_from_headers ( self . headers ) , namespaceHTMLElements = False , ) base_url = _determine_base_url ( document , self . url ) for anchor in document . findall ( ".//a" ) : link = _create_link_from_element ( anchor , page_url = self . url , base_url = base_url , ) if link is None : continue yield link