Reputation: 14046
I've an element with text List
which I want to use. I can write xpath like -
//li[text()='List']
but instead of using xpath, I want to use css. How should I write css for it? I tried with following by referring https://saucelabs.com/resources/selenium/css-selectors but didn't work.
li:contains('List')
Upvotes: 1
Views: 141
Reputation: 2105
The CSS feature :contains('some text')
is deprecated, you should only use xpath in your case. There is no way to do that using CSS
Upvotes: 1