/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
P.S。基于Debian的操作系统
答案 0 :(得分:1)
所以在linux上;对于生锈应用,这是documentation here
有关gecko-driver here
的更多文档基于 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上也有预编译的二进制文件。
答案 1 :(得分:0)
我刚刚回答similar question解释了如何避免在Windows中添加geckodriver到PATH,但几乎可以肯定这种方法也适用于Linux。
答案 2 :(得分:0)
更新selenium后我遇到了同样的问题。我将selenium降级到版本2.53.6并且使用Firefox28.0它不会要求geckodriver。