Python Splinter无法打开Firefox - geckodriver的问题

时间:2016-10-18 16:29:52

标签: python selenium firefox

我开发了一个使用Splinter / Python / Docker的小型刮刀。一切都运行良好,但现在我每次尝试运行刮刀时都会出错。

File "/usr/local/lib/python2.7/dist-packages/splinter/browser.py", line 63, in Browser
return driver(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-pa ckages/splinter/driver/webdriver/firefox.py", line 39, in __init__
self.driver = Firefox(firefox_profile)
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. 

我已尝试重新安装/降级firefox,但问题仍然存在。

Firefox 49.0和Firefox 45.02(我累了)

硒== 3.0.1

碎片== 0.7.3

Python 2.7

相关代码

url = 'https://track.anpost.ie'
display = Display(visible=0, size=(1024, 768))
display.start()
executable_path = {'executable_path':'/usr/bin/firefox'}
browser = Browser('firefox', **executable_path) 
browser.visit(url)

并且追溯

File "scraper.py", line 15, in anpost
        browser = Browser('firefox', **executable_path)
File "/usr/local/lib/python2.7/dist-packages/splinter/browser.py", line 63, in Browser
        return driver(*args, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'executable_path'

0 个答案:

没有答案