[lxml-dev] removing nested element from html wipes text
28 Jan
2008
28 Jan
'08
12:03 p.m.
Hi I got missing text after removing last element.. I've tried 2.0 beta but still no luck. txt=""" '<p> startPara <strong>str0ng</strong> MiddleP <u>UUUUUUUUU</u> <b>Bold</b> EndPara </p>""" ee=etree.HTML(txt) pp=ee.xpath('//p')[0]
pp.tail
pp.xpath('./text()') ['startPara', 'MiddleP', 'EndPara']
bold=pp.xpath('./b')[0] bold.clear()
pp.xpath('./text()') ['startPara', 'MiddleP']
as at seen EndPara text is missing
5903
Age (days ago)
5904
Last active (days ago)
1 comments
2 participants
participants (2)
-
iShTa dAsaH
-
Stefan Behnel