我在使用geckodriver
0.19.0的新版本时遇到了相同的问题
webdriver.Firefox(),
driver.implicitly_wait(IMPLICIT_WAIT)并通过安装新版本的geckodriver解决了它(我之前是2017年6月的版本)。
从此处下载geckodriver:https :
//github.com/mozilla/geckodriver/releases。
我的配置:
- Firefox 56.0
- 硒版本:3.4.3
检查shell中的geckodriver版本:
$ geckodriver -Vgeckodriver 0.19.0
默认情况下,硒将使用您路径中的Firefox版本。要更改为另一个版本,请使用:
from selenium.webdriver.firefox.firefox_binary import FirefoxBinarybinary = FirefoxBinary(firefox_path='your firefox path', log_file='your logfile path')driver = webdriver.Firefox(firefox_binary=binary)
硒WebDriver的文档



