Nipun Tanay
Nipun Tanay

Reputation: 59

How to find xpath of a text element without node

 <h1>
<span class="visually-hidden">BBC Radio</span>
   Search results for 'archers'  
</h1>

I want to locate the text element "Search results for 'archers'" . What will be the xpath that will locate to it and not to the element in span node ??

Upvotes: 0

Views: 98

Answers (1)

Krlos
Krlos

Reputation: 140

For your input sample

/h1/text()

Tested on http://videlibri.sourceforge.net/cgi-bin/xidelcgi

returns Search results for 'archers'

Upvotes: 1

Related Questions