Using text as identifying an element in cdp-mode? #4001
-
Hello - is there any way to identify an element using only the text in cdp-mode? For example this is not working for me: Is there any solution to get an element simply according to the text? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Use the SeleniumBase/examples/cdp_mode/raw_indeed.py Lines 16 to 25 in 0034475 Note that XPath is not supported for CDP Mode (unless it's a simple selector that can be converted easily into CSS). |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot - this seems to work for me. |
Beta Was this translation helpful? Give feedback.
-
ok - thanks also for that clarification - so this problem is done |
Beta Was this translation helpful? Give feedback.
Use the
:contains(TEXT)
selector via CSS, example:SeleniumBase/examples/cdp_mode/raw_indeed.py
Lines 16 to 25 in 0034475
Note that XPath is not supported for CDP Mode (unless it's a simple selector that can be converted easily into CSS).