I have this xpath: //a[contains(text(), 'My Text')]
and I want to convert it to css.
I tried with a:contains('My Text')
but not work.
You don't have to quote the text. Just use a:contains(My Text)
.
Example: https://jsoup.org/cookbook/extracting-data/selector-syntax