[lxml-dev] text of an etree Element

Stefan Behnel stefan_ml at behnel.de
Thu Jun 19 09:36:29 CEST 2008


Ofer Kalisky wrote:
> When I access some node's text (node.text) I get only the first text value
> of it, for example, if the html is:
>
> <html><body>asdf<b>something</b>qwer</body></html>
>
> and "node" is the "<body>", then node.text retrieves asdf.
> if I use node.itertext(), I get [asdf, something, qwer], which is again,
> not what I want...
>
> is there a way to reach the other text of a node ("qwer")?

http://codespeak.net/lxml/tutorial.html#elements-contain-text

Stefan



More information about the lxml-dev mailing list