Skip to content

Seleniumbase element not located, despite valid XPATH. #3400

Answered by mdmintz
ZcodeZ777 asked this question in Q&A
Discussion options

You must be logged in to vote

Either directly use a CSS Selector, or make sure your XPath class doesn't contain special characters, such as :.
Your XPath class had : twice: In md:iv-text-body-m, and in dark:iv-text-grey-30.

It all gets converted into CSS anyway. Because class segment order can change, a class like "part1 part2 part3" gets converted into dot-notation like this: ".part1.part2.part3".

Therefore, sb.cdp.find_element('//button[@class="iv-inline-block iv-text-body-xl iv-text-black-50 iv-font-semibold iv-cursor-pointer"]') works because the class segments with : were removed.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
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