Skip to content

is sb.switch_to_frame making me detectable in CDP? #3760

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

You must be logged in to vote

switch_to_frame() is a WebDriver-only method. Calling that will switch to WebDriver Mode, which makes you detectable.
See the bottom of SeleniumBase/examples/cdp_mode/ReadMe.md for CDP Mode methods.

You may be able to use these for interacting with elements inside of iframes: (Use the iframe selector as the parent_selector)

sb.cdp.nested_click(parent_selector, selector)
sb.cdp.get_nested_element(parent_selector, selector)

The selector you used inside of get_nested_element() is incorrect. (You didn't have a closing bracket ] for your selector.)
There's a method, sb.uc_gui_click_captcha() for clicking on CAPTCHAs (specifically Turnstile and reCAPTCHA), but there are no guarantees it'll work…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by mdmintz
Comment options

You must be logged in to vote
0 replies
Comment options

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

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