I’m using the xpath engine on Firefox. I have html:
<span>
<b>prefix one</b> not bold part
</span>
<span>
prefix two not bold part
</span>
I want all the spans that have child text that start with “prefix one”.
I tried the xpath:
//span[starts-with(child::text(), "prefix one")]
but this doesn’t work because the b tag is interfering. How do you solve this?
thanks
If you know that spans is not nested into other spans you can try this:
descendant-or-self::*/text(),should return all text nodes which are in this subtree. I don’t know howstarts-with()exactly works but I suppose when some oftext()nodes in subtree starts with “prefix one” that condition is true