Py学习  »  Python

如何在python web驱动程序[duplicate]中解决此错误

manish uniyal • 5 年前 • 1484 次点击  

我想在服务器上使用selenium构建我的爬虫程序。

因此,我在ubuntu17.10服务器上安装/下载了所需的依赖项,如chromedriver、chromium浏览器等。

但是,当我运行以下代码时:

driver = webdriver.Chrome()

它返回以下错误:

---------------------------------------------------------------------------
WebDriverException                        Traceback (most recent call last)
<ipython-input-14-2cdab8938403> in <module>()
----> 1 driver = webdriver.Chrome()

/home/zachary/.local/lib/python3.6/site-packages/selenium/webdriver/chrome/webdriver.py in __init__(self, executable_path, port, options, service_args, desired_capabilities, service_log_path, chrome_options)
     66             service_args=service_args,
     67             log_path=service_log_path)
---> 68         self.service.start()
     69 
     70         try:

/home/zachary/.local/lib/python3.6/site-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

/home/zachary/.local/lib/python3.6/site-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: 127

兴奋是什么意思?

我不知道错误代码的初衷是什么,也不知道从哪里开始修复。

这看起来很罕见。

可能相关:

我已经在我的桌面上安装了ubuntu desktop 17.10,但是未能启动gui。因此,我只是在使用终端,但目前为止它工作良好。 我已经安装了ssh和远程控制jupyter笔记本,从我的mac到服务器桌面,这些错误都来自它。 希望此信息与解决此错误相关,否则将中止它。

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/40364
 
1484 次点击  
文章 [ 6 ]  |  最新文章 5 年前