我已经将Splnter与GeckoDriver和Firefox一起使用了几个月,直到Firefox今天升级到63.0为止,一切都很好。
现在,当我尝试使用以下代码运行Splinter时,我会立即得到其后的错误。
from splinter import Browser
browser = Browser()
Traceback (most recent call last):
File "<ipython-input-2-a8fa3d213da9>", line 16, in <module>
browser = Browser()
File "C:\Users\user\AppData\Local\Continuum\Anaconda3\lib\site-packages\splinter\browser.py", line 63, in Browser
return driver(*args, **kwargs)
File "C:\Users\user\AppData\Local\Continuum\Anaconda3\lib\site-packages\splinter\driver\webdriver\firefox.py", line 57, in __init__
timeout=timeout, **kwargs)
File "C:\Users\user\AppData\Local\Continuum\Anaconda3\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 154, in __init__
keep_alive=True)
File "C:\Users\user\AppData\Local\Continuum\Anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 151, in __init__
self.start_session(desired_capabilities, browser_profile)
File "C:\Users\user\AppData\Local\Continuum\Anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 240, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "C:\Users\user\AppData\Local\Continuum\Anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 308, in execute
self.error_handler.check_response(response)
File "C:\Users\user\AppData\Local\Continuum\Anaconda3\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 194, in check_response
raise exception_class(message, screen, stacktrace)
WebDriverException: newSession
谢谢!
答案 0 :(得分:0)
我必须获取最新版本的GeckoDriver,并将其安装在保存Python.exe的位置。 问题解决了。