lxml.html.fromstring insists on wrapping up everything in a tag (p default). From this tag tree,
<p>this is <b>the</b> good stuff<p>
I want to extract the string:
this is <b>the</b> good stuff
How do I do this?
lxml.html.fromstring insists on wrapping up everything in a tag (p default). From this tag tree,
<p>this is <b>the</b> good stuff<p>
I want to extract the string:
this is <b>the</b> good stuff
How do I do this?
Copyright © 2021 Jogjafile Inc.
That's often referred to as "inner xml" rather than "inner text". This is one possible way to get inner xml of an element :
output :