Skip to content

convert_xpath_to_css does not support long xpath #2732

Answered by mdmintz
STARKILLER-1 asked this question in Q&A
Discussion options

You must be logged in to vote

Not every XPath has a matching CSS Selector. There isn't even a :contains("TEXT") selector in CSS. SeleniumBase has a special TAG:contains("TEXT") selector, which gets converted to XPath before use, but you need to make a JavaScript call, which requires a normal CSS Selector (and that doesn't allow any kind of :contains("TEXT") selector).

This means that you should either provide a CSS Selector directly, or an XPath Selector that can be converted into a natural CSS Selector. Otherwise you'll get errors, the uc_click(selector) won't work, or the uc_click(selector) won't click with stealth.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@STARKILLER-1
Comment options

Answer selected by mdmintz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants