Based in the following HTML I want to extract TextA, TextC and TextE.
<div id='content'>
TextA
<br/>
<br/>
<p>TextB</p>
TextC
<br/>
TextC
<p>TextD</p>
TextE
</div>
I tried to get TextC like so but I don't get the result I want:
- Query:
//*[preceding::p[contains(.,"TextB")] and following::p[contains(.,"TextD")]]
- Expected result:
["TextC", <br/>, "TextC"]
- Actual result:
[<br/>]
Is there a way to select the text nodes without using indexes like //div/text()[1]
?
, "TextC"]`. Please clearly explain what it is you're trying to do. – JLRishe Sep 15 '16 at 17:10