ElementTree, how to get the whole content of a tag

Damjan gdamjan at gmail.com
Wed Mar 16 21:34:01 EST 2005


>> Is there any way I could get everything between the <div> and </div> tag?
>>
>> <div>
>>  text
>>  some other text<br/>
>>  and then some more
>> </div>

>>>> gettext(et)
> '\n  text\n  some other text\n  and then some more\n'

I acctually need to get 
'\n  text\n  some other text<br/>\n  and then some more\n'

And if there were attributes in <br/> I'd want them too where they were. 
Can't I just get ALL the text between the <div> tags?

-- 
damjan



More information about the Python-list mailing list