如何解决错误“ WebDriverException:消息:服务chromedriver意外退出。状态代码为:-6”?

时间:2018-11-14 10:15:48

标签: python google-chrome

我正在使用Webdriver Selenium。我遇到以下错误

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 

我从许多渠道寻找。并实现了错误为铬版。因此,我尝试使用!sudo apt-get install -y chromium-browser安装最新版本。但是,它在我的Google Colab上不起作用。

0 个答案:

没有答案