我一直在为此绞尽脑汁。我得到了一个错误:System geckodriver unexpectedly exited. Status code: -11.
我正在使用一个Linux服务器,它是一个共享的托管web服务器。我把一切都安排在虚拟环境中。在Linux服务器-CentOS,版本:7.4.1708
Selenium 3.141.0版
geckodriver 0.23.0版
火狐60.3.0
Python3.6.2,不能使用更新的版本
Python、Selenium和Geckodriver驻留在linuxweb服务器上的虚拟环境中。Firefox位于虚拟环境之外export PATH=$PATH:/path/to/geckodriver
在PATH环境变量中使用geckodriver。在
以下是我的代码:
^{pr2}$
以下是我的回溯错误:Traceback (most recent call last):
File "selen.py", line 20, in
browser = webdriver.Firefox(firefox_options=opts, executable_path=path)
File "/home/DIRECTORY/DIRECTORY/DIRECTORY/venv/lib/python3.6/site-packages/selenium/webdriver/firefox/webdriver.py", line 164, in __init__
self.service.start()
File "/home/DIRECTORY/DIRECTORY/DIRECTORY/venv/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 98, in start
self.assert_process_still_running()
File "/home/DIRECTORY/DIRECTORY/DIRECTORY/venv/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 111, in assert_process_still_running
% (self.path, return_code)
selenium.common.exceptions.WebDriverException: Message: Service /home/DIRECTORY/DIRECTORY/DIRECTORY/venv/bin/geckodriver unexpectedly exited. Status code was: -11
为什么我会遇到这个错误,我该如何修复它?在