Вы выполнили анализ, который вы можете увидеть, если выполните следующее:
>>> tree
<lxml.etree._ElementTree object at 0x0148AF08>
Теперь вы можете пройти через этот элемент, используя lxml._ElementTree
функции, описанные здесь: http://lxml.de/tutorial.html
Вот некоторые основы, с простым файлом, который я получил из своей локальной сети:
>>> tree.getroot()
<Element html at 147aae0>
>>> tree.getroot().tag
'html'
>>> tree.getroot().text
>>> for child in tree.getroot().getchildren():
print child.tag, child.getchildren()
head
body
>>> for child in tree.getroot().getchildren():
print child.tag, [sub_child.tag for sub_child in child.getchildren()]
head ['title']
body ['h1', 'p', 'hr', 'address']