Select the second to last item in a list with Xpath
Use xpath to select the second to last item in an array or list. You can use last() which represents the last item in the context:
1 |
//li[last() - 1]/text() |
Use xpath to select the second to last item in an array or list. You can use last() which represents the last item in the context:
1 |
//li[last() - 1]/text() |
Write an XPath for the div based on its contained text. With the implicit . or the explicit string() first argument, all text node descendants are concatenated together before performing the contains()test, so the test passes.
1 |
<span class="pln">//div[contains(string(), "This is the text we're looking for")]</span> |