![](https://secure.gravatar.com/avatar/cb9127c432f778bc97608ff6f776d529.jpg?s=120&d=mm&r=g)
The documentation for make_links_absolute says: If ``resolve_base_href`` is true, then any ``<base href>`` tags in the document are used *and* removed from the document. If it is false then any such tag is ignored. This doesn't seem to work (lxml 4.6.4). Example: import lxml.html tree = lxml.html.fromstring('<base href="http://example.org/"/> <a href="http://example.com/">Test</a> <a href="#test">Test2</a>') # Removes base tree.make_links_absolute('http://lxml.de', resolve_base_href=False) print(lxml.html.tostring(tree)) If the base is being ignored, at the end of this I should end up with http://lxml.de/#test. Also, this can still fail even if handle_failures='ignore': import lxml.html tree = lxml.html.fromstring('<base href="http://example.org/"/> <a href="http://example.com[/">Test</a>') tree.make_links_absolute('http://lxml.de', handle_failures='ignore') print(lxml.html.tostring(tree))
participants (1)
-
Tyler Spivey