Skip to content

Instantly share code, notes, and snippets.

@dangra
Created December 30, 2013 21:24
Show Gist options
  • Save dangra/8188375 to your computer and use it in GitHub Desktop.
Save dangra/8188375 to your computer and use it in GitHub Desktop.
>>> import lxml.etree
>>> root = lxml.etree.fromstring('<html></html>', base_url='http://foo.com/?a=|')
>>> root.getroottree().docinfo.URL
u'http%3A//foo.com/%3Fa=%257C'
>>> root = lxml.etree.fromstring('<html></html>', base_url='http://foo.com/?a=b')
>>> root.getroottree().docinfo.URL
u'http://foo.com/?a=b'
@abeautifulmime
Copy link

Can you explain this further ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment