13 May
2018
13 May
'18
4:58 a.m.
Hi, I'd like to get the text that would be got from tostring() except removing the outmost tag. Something like <foo>abc<em>x<u>y</u>z</em>123<h>f</h>uvw</foo> should be returned as abc<em>x<u>y</u>z</em>123<h>f</h>uvw I could do so by calling tostring() then use regex to remove the outermost tag. Alternatively, the code below can be customized. But I feel the 2nd approach is an overkill for this problem. Does anybody know what is the best approach for this problem? Thanks. https://stackoverflow.com/questions/11677411/python-lxml-access-text?answert... -- Regards, Peng