In a page HTML, there are several HTML links whose names contains some sub nodes.
I want to retrieve only one of them; the following:
<a href='foo'>
<b>Bar</b>
<div style="height: 18px;">Garbo</div>
</a>
To target it, I want to precise with xpath: “Bring me the link which contains both “Bar” as “Garbo”, no matters if they are in separated sub nodes“.
I try this one, but after reading some articles about contains function, this line could never work:
//a[contains(text(),"Bar") and contains(text(),"Garbo")]
What fix could I make to fulfill my requirements?
The selector you need to use is