I'd like to select some text from a webpage using Xpath, but this text is between two nodes.
...
<table>
<th>Abbreviation</th>
<tr>
<td>
<span><u>General</u><br/></span>
My Text <!--The text i want to get-->
<br/><u>Def</u>
Some other Text
</td>
</table>
...
Please note that i can't alter the page since it's a source that i can't control.
I've already been through the W3C and wikipedia docs and dodn't found anything (or understood).
Thank you for your answers
You can use the following XPath expression. It searches for a span
with a u
child, then it selects the first following text.
//span[u]/following-sibling::text()[1]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With