【发布时间】:2018-08-25 15:50:13
【问题描述】:
我想在我的服务器上使用 selenium 构建我的爬虫。
因此我已经在我的 Ubuntu17.10 服务器上安装/下载了所需的依赖项,例如 chromedriver、chromium-browser 等
但是,当我运行以下代码时:
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 notebook 从我的 mac 安装到服务器桌面,这些错误来自它。 希望此信息与解决此错误相关,否则将中止它。
【问题讨论】:
标签: python google-chrome selenium selenium-webdriver selenium-chromedriver