我正在使用 webdriver 硒。我遇到以下错误:
WebDriverException Traceback (most recent call last)
<ipython-input-10-25c7a5245744> in <module>()
1 from selenium import webdriver
----> 2 driver = webdriver.Chrome()
3 driver.get("http://www.google.com")
4 display.stop()
/usr/local/lib/python3.6/dist-packages/selenium/webdriver/chrome/webdriver.py in __init__(self, executable_path, port, options, service_args, desired_capabilities, service_log_path, chrome_options, keep_alive)
71 service_args=service_args,
72 log_path=service_log_path)
---> 73 self.service.start()
74
75 try:
/usr/local/lib/python3.6/dist-packages/selenium/webdriver/common/service.py in start(self)
96 count = 0
97 while True:
---> 98 self.assert_process_still_running()
99 if self.is_connectable():
100 break
/usr/local/lib/python3.6/dist-packages/selenium/webdriver/common/service.py in assert_process_still_running(self)
109 raise WebDriverException(
110 'Service %s unexpectedly exited. Status code was: %s'
--> 111 % (self.path, return_code)
112 )
113
WebDriverException: Message: Service chromedriver unexpectedly exited. Status code was: -6
I used chromium-browser version (70.0.3538.77-0ubuntu0.18.04.1)
, selenium 3.141.0
, and chromedriver version 2.43
.
我从许多来源进行搜索并意识到错误是铬版本。所以,我尝试安装最新版本!sudo apt-get install -y chromium-browser
尽管如此,它在我的 google colab 上不起作用。
请帮我解决它。非常感谢!
sudo snap install chromium
对我来说,这就是问题所在。通常sudo apt install chromium-chromedriver
也会安装快照,但如果没有安装快照,则必须手动安装快照。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)