I want to grab a collection of all the links on a page with inner text.
These are valid cases:
<a>Foo</a>
<a><span>Bar</span></a>
These are invalid cases:
<a></a>
<a><span></span></a>
I have tried:
//a[text()]
but this ignores the case with the spans
//a[not(text()='')]
but this doesn't filter out the empty case
Is there some way to check if the text()=NULL
?
Note:
I know I can use document.links;
and then filter manually, but I would rather just have one clean expression.