一尘不染

selenium的GeckoDriver不在全球范围内

selenium

/usr/bin/python2.7 /home/USER/Documents/python/tools/swagSearcher/swagSearcher.py
Traceback (most recent call last):

File "/home/lyend/Documents/python/tools/swagSearcher/swagSearcher.py", line 6, in <module>

web = webdriver.Firefox() # This is the break/error point in my code

File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py", line 135, in __init__

self.service.start()
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/common/service.py", line 71, in start

os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.

Exception AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.firefox.service.Service object at 0x7f0a7e776c90>> ignored

Process finished with exit code 1

感谢您提供有关此错误的帮助。- 毫不费劲地搜寻我的解决方案

是的,我尝试过 pip install -U selenium

基于PS Debian的操作系统


阅读 266

收藏
2020-06-26

共1个答案

一尘不染

因此在linux上;对于防锈应用,这是这里文档

有关gecko-driver的更多文档,请点击此处

说明一个 Ubuntu的 基础系统。

git clone https://github.com/mozilla/geckodriver.git
cd geckodriver
chmod +x build.sh && ./build.sh
cargo build
sudo mv target/geckodriver /usr/bin
geckodriver -h

如果编译对您不起作用,那么github上也会有预编译的二进制文件。

2020-06-26