ElementTree.findtext()

Richie Hindle richie at entrian.com
Fri Jan 21 15:47:10 CET 2005


[me]
> >>> print tree.findtext("html/head/title")
> None

I realised what the problem was the second after I hit Send (why is it
never the second *before*?)  The tree represents the top-level <html>
element, so of course searching within it for 'html' fails.  What I should
say is this:

>>> print tree.findtext("head/title")
The title

Sorry to waste people's time!

-- 
Richie Hindle
richie at entrian.com




More information about the Python-list mailing list