Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

CDPMethods does not have uc_gui_click_captcha #3659

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

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

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

Comment options

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.

You must be logged in to vote
2 replies
Comment options

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)
Comment options

Connecting to existing browsers with stealth must be done via the CDP API.

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

AltStyle によって変換されたページ (->オリジナル) /