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
  • 16,276
  • 55
  • 159
  • 284
  • 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,506
  • 2
  • 28
  • 69