Parse text of element with empty element inside
- by Mando
I'm trying to convert an XHTML document that uses lots of tables into a semantic XML document in Python using xml.etree. However, I'm having some trouble converting this XHTML
<TD>
Textline1<BR/>
Textline2<BR/>
Textline3
</TD>
into something like this
<lines>
<line>Textline1</line>
<line>Textline2</line>
<line>Textline3</line>
</lines>
The problem is that I don't know how to get the text after the BR elements.