lxml and links

Stefan Behnel stefan_ml at behnel.de
Sat Jun 28 01:00:41 EDT 2008


Ampedesign wrote:
> I'm trying to extract all the links on a page with lxml. Ideally, I
> would like it to return me a list of hrefs of each link on the page,
> in a list.
> 
> How would I go about doing this?

Read the manual?

http://codespeak.net/lxml/dev/lxmlhtml.html#working-with-links
http://codespeak.net/lxml/dev/tutorial.html#tree-iteration
http://codespeak.net/lxml/dev/xpathxslt.html#xpath

Stefan



More information about the Python-list mailing list