我想在我的服务器上使用selenium构建我的爬虫.
因此我在我的Ubuntu17.10服务器上安装/下载了所需的依赖项 - 例如chromedriver,chromium-browser等
但是,当我运行以下代码时:
driver = webdriver.Chrome()
它返回以下错误:
---------------------------------------------------------------------------
WebDriverException Traceback (most recent call last)
in ()
----> 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启动.因此我只使用终端,但它到目前为止工作良好.我已经从我的mac到服务器桌面安装了ssh和远程控制jupyter笔记本,这些错误来自它.希望此信息与解决此错误相关,否则将中止.