KunLun
KunLun

Reputation: 3225

Convert XPath into CssSelector for Jsoup

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.

Upvotes: 0

Views: 103

Answers (1)

Krystian G
Krystian G

Reputation: 2941

You don't have to quote the text. Just use a:contains(My Text).
Example: https://jsoup.org/cookbook/extracting-data/selector-syntax

Upvotes: 1

Related Questions