GeckoDriver for selenium不在全球范围内

2024-10-01 17:27:58 发布

您现在位置:Python中文网/ 问答频道 /正文

/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

如果你能帮我解决这个错误,我将不胜感激。-再多的google搜索都无法让我找到解决方案

是的,我试过pip install -U selenium

基于p.S.Debian的操作系统


Tags: inpyselfhomeusrseleniumserviceline
2条回答

所以在linux上;对于rust应用程序,这是documentation here

有关壁虎驱动程序的更多文档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上也有预编译的二进制文件。在

我在更新selenium之后也遇到了同样的问题。我把selenium的版本降到了2.53.6,Firefox28.0并没有要求geckodriver。在

相关问题 更多 >

    热门问题