changing URLs in webpages, python solutions?
stefan_ml at behnel.de
Sun Jan 18 17:40:22 CET 2009
Simon Forman wrote:
> I want to take a webpage, find all URLs (links, img src, etc.) and
> rewrite them in-place, and I'd like to do it in python (pure python
lxml.html has functions specifically for this problem.
Code would be something like
html_doc = lxml.html.parse(b"http://.../xyz.html")
html_doc.rewrite_links( ... )
print( lxml.html.tostring(html_doc) )
More information about the Python-list