Richie> I realised what the problem was the second after I hit Send (why
Richie> is it never the second *before*?)
So you could enlighten those of us who didn't realize what the problem was,
even ten seconds later than that...
Richie> The tree represents the top-level element, so
[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
element, so of course searching within it for 'html' fails. What I should
say is this:
>>> print tree.f
Hi,
I can't get ElementTree.findtext() to work with anything other than a
single-level path:
>>> from elementtree import ElementTree
>>> tree = ElementTree.fromstring("""\
...
...
...
... The title
...
...
... """)
>>> print tr