[lxml-dev] Setting URL from lxml.html.fromstring, etc

Stefan Behnel stefan_ml at behnel.de
Tue Feb 19 13:06:05 CET 2008


Hi,

Ian Bicking wrote:
> It does not appear that html.parse() takes a base_url argument (just as
> etree.parse does not).  If you pass a URL or filename then I suppose
> that becomes the base.  If you pass in a file-like object then I think
> it also works, if the file-like object has a geturl() method (like
> urllib's files do).

I added the base_url keyword to parse() for now, so that you can set the URL
for file-like objects.

Stefan




More information about the lxml-dev mailing list