alright, i was finally able to get captcha clicking in a container working! thanks again for your previous help for suggesting that i try to get PyAutoGUI working in Docker.
I am now running into another issue related to what i posted earlier in #🐙-cdp-mode this morning. But seems like on Docker (specifically Linux seems like) trying to click captcha in CDP mode doesn't work when UC mode does.
I do have a suspicion that it might be related to my nest_asyncio.apply() call there, however i need it since i'm calling my seleniumbase script in an async context (my code basically does a GET request to a running webserver with uvicorn which then fires off this seleniumbase script)
my sample script i'm using where UC mode works but CDP mode doesn't (again happens in Linux on a container running an xvfb display)
nest_asyncio.apply()
async def test_selenium_webdriver():
screenshots = []
with SB(
xvfb=True,
uc=True,
) as sb:
await do_test_1_uc_mode(sb)
print("about to do cdp mode driver stuff")
with SB(
xvfb=True,
uc=True,
) as sb:
do_test_1_cdp_mode(sb)
async def do_test_1_uc_mode(sb):
# Checks if we can click captcha in uc mode
url = "https://seleniumbase.io/apps/turnstile"
sb.uc_open_with_reconnect(url, reconnect_time=4)
print("was able to open url in uc mode")
sb.sleep(2)
sb.uc_gui_click_captcha()
sb.sleep(3)
def do_test_1_cdp_mode(sb):
# Checks if we can click captcha in uc mode
url = "https://seleniumbase.io/apps/turnstile"
sb.activate_cdp_mode(url)
print("was able to open url in cdp mode")
sb.sleep(2)
sb.uc_gui_click_captcha()
sb.sleep(3)
I did see you put some stuff here: https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/raw_async.py however i wasn't able to call uc_gui_click_captcha() using the raw CDP driver. Anything obvious that i'm doing wrong here?