Replies: 2 comments
-
Some things I've tried as I've been debugging:
The chrome instance seems to start as soon as the code crashes as well (opens up a window after catching the Exception). |
Beta Was this translation helpful? Give feedback.
-
That's due to a change in https://github.com/python-websockets/websockets (a dependency of NoDriver).
Or, in the meantime, you can use my patched version of Undetected Chromedriver and NoDriver in https://github.com/seleniumbase/SeleniumBase (UC Mode and CDP Mode) Example: from seleniumbase import SB
with SB(uc=True, test=True, ad_block=True) as sb:
url = "https://www.browserscan.net/bot-detection"
sb.activate_cdp_mode(url)
sb.cdp.flash("Test Results")
sb.cdp.assert_element('strong:contains("Normal")')
sb.sleep(1)
sb.cdp.save_screenshot("b_scan.png") |
Beta Was this translation helpful? Give feedback.
-
Hi everyone,
Getting this error after pushing and pulling my project onto a new computer. Using Python 3.10.9
Traceback (most recent call last):
File ****, line 1320, in
uc.loop().run_until_complete(main_script())
File ****, line 90, in run_until_complete
return f.result()
File ****, line 201, in result
raise self._exception.with_traceback(self._exception_tb)
File ****, line 232, in __step
result = coro.send(None)
File ****, line 622, in main_script
bot = await uc.start(no_sandbox=True)
File ****, line 96, in start
return await Browser.create(config)
File ****, line 91, in create
await instance.start()
File ****, line 352, in start
raise Exception(
Exception:
---------------------
Failed to connect to browser
---------------------
One of the causes could be when you are running as root.
In that case you need to pass no_sandbox=True
Exception ignored in atexit callback: <function deconstruct_browser at 0x7fa21a5ba560>
Traceback (most recent call last):
File ****, line 146, in deconstruct_browser
_.stop()
File ****, line 558, in stop
asyncio.get_event_loop().create_task(self.connection.aclose())
AttributeError: 'NoneType' object has no attribute 'aclose'
I've read some older posts and usually had found that using "pkill -9 -f "Google Chrome" had worked when I encountered this crash on my old computer, but I'm always getting this error now with no workaround on my new computer. I've also seen someone speak about a user_data_dir being corrupted but I'm not sure where to find that or fix it. Any work around for this?
Beta Was this translation helpful? Give feedback.
All reactions