-
Notifications
You must be signed in to change notification settings - Fork 1.4k
-
I'm trying to connect to an existing port and solve the CF captcha, but this method is not available, please tell me how to do it correctly
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
host = "127.0.0.1"
driver = loop.run_until_complete(cdp_util.start(host=host, port=port))
page = loop.run_until_complete(driver.get(url))
sb = sb_cdp.CDPMethods(loop, page, driver)
sb.sleep(5)
sb.uc_gui_click_captcha()
sb.sleep(5)
Beta Was this translation helpful? Give feedback.
All reactions
The CDP API is different from the SB one. SB in UC Mode has special methods.
For the CDP methods, see: SeleniumBase/examples/cdp_mode/ReadMe.md
You might be able to use sb.cdp.gui_click_element(selector)
as an alternative,
such as in SeleniumBase/examples/cdp_mode/raw_planetmc.py.
Replies: 1 comment 2 replies
-
The CDP API is different from the SB one. SB in UC Mode has special methods.
For the CDP methods, see: SeleniumBase/examples/cdp_mode/ReadMe.md
You might be able to use sb.cdp.gui_click_element(selector)
as an alternative,
such as in SeleniumBase/examples/cdp_mode/raw_planetmc.py.
Beta Was this translation helpful? Give feedback.
All reactions
-
that option doesn't work for me :(
image
Is there any way to use this code but connect to an existing port without opening new browsers?
with SB(uc=True, test=True, locale="en") as sb:
url = "https://gitlab.com/users/sign_in"
sb.activate_cdp_mode(url)
sb.uc_gui_click_captcha()
sb.sleep(2)
Beta Was this translation helpful? Give feedback.
All reactions
-
Connecting to existing browsers with stealth must be done via the CDP API.
Beta Was this translation helpful? Give feedback.