Finding a span with specific content using xpath
html, selenium, xml, xpath
Solution
You are missing `//` at the beginning of the XPath.
- One slash would mean "a span that is a child of a root node".
- Two slashes mean "find me any span with that text".
`//span[text()='thisisatest']`
Problem
I have some span's like this: ``` <span> <span>foobar</span> <span>thisisatest</span> </span> ``` I'm trying to use xpath to find the span with "thisisatest" in it. I've tried this: `span[text()='thisisatest']` and it doesn't seem to be working.