0

I have a div without id or class that I need to select. I'd like to do that by value (since the only way I can think of to get it):

<div style=""> foo: baa </div>

How can I do that?

Imagine XPath query: //div[contains(@innerText,'foo:')]

Jack
  • 15,539
  • 54
  • 145
  • 264
  • There are plenty of similar questions - you probably looking for "how to pass current node to XPath function" ("."/"self"/"current()") - http://stackoverflow.com/questions/1022345/current-node-vs-context-node-in-xslt-xpath. – Alexei Levenkov Nov 04 '14 at 23:26

1 Answers1

1

You are looking for this:

//div[contains(.,'foo:')]
Steve Wellens
  • 20,326
  • 2
  • 25
  • 66