Question

Given the following XML structure

<html>
  <body>
    <div>
      <span>Test: Text2</span>
    </div>
    <div>
      <span>Test: Text3</span>
    </div>
    <div>
      <span>Test: Text5</span>
    </div>
  </body>
</html>

What is the best XPath query to locate any span with text that starts with Test?

OTHER TIPS

Valid option is also:

//span[contains(.,'Test')]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top