Selenium与selenium.common.exceptions.WebDriverException一起崩溃:消息:newSession [英] Selenium crashing with selenium.common.exceptions.WebDriverException: Message: newSession

查看:60
本文介绍了Selenium与selenium.common.exceptions.WebDriverException一起崩溃:消息:newSession的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

OS:Ubuntu 16.04.3 LTS(GNU/Linux 4.4.0-1066-aws x86_64)

OS: Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-1066-aws x86_64)

硒版本:selenium == 3.6.0

Selenium Version: selenium==3.6.0

浏览器:Mozilla Firefox 63.0

Browser: Mozilla Firefox 63.0

Geckodriver版本:geckodriver-v0.19.0-linux64

Geckodriver version : geckodriver-v0.19.0-linux64

创建一个新的firefox浏览器并执行一些步骤-解析网站.

Create a new firefox browser and do some steps - parsing the website.

使用日志崩溃:-

    self.driver = webdriver.Firefox()
  File "/home/ubuntu/env/local/lib/python2.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 154, in __init__
    keep_alive=True)
  File "/home/ubuntu/env/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 151, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "/home/ubuntu/env/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 240, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/home/ubuntu/env/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 308, in execute
    self.error_handler.check_response(response)
  File "/home/ubuntu/env/local/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: newSession

有人有没有遇到过这个问题并且有可能的解决方法?

Has anyone faced this issue before and has a possible solution ?

更新:运行以下命令: geckodriver --log trace&curl -d'{}'127.0.0.1:4444/session

UPDATE : Ran the following command : geckodriver --log trace & curl -d '{}' 127.0.0.1:4444/session

日志:- https://pastebin.com/TirTNKrG

推荐答案

我通过更新硒python软件包并使用最新的geckodriver解决了该问题.

I fixed the issue by updating the selenium python package and using the latest geckodriver.

感谢@fzbd的所有帮助.

Thanks @fzbd for all your help.

其他上下文-

请参阅此处的兼容性图表- https://firefox-source-docs.mozilla.org/testing/geckodriver/Support.html#supported-platforms

Refer to the compatibility chart here - https://firefox-source-docs.mozilla.org/testing/geckodriver/Support.html#supported-platforms

更新硒:

 pip install -U selenium

更新geckodriver (根据上面的兼容性图表,根据您的需求选择正确的版本)

update geckodriver (choose the correct version for your needs based on the above compatibility chart)

检查所有组件的版本-

firefox -v
geckodriver -V
pip freeze | grep selenium

这篇关于Selenium与selenium.common.exceptions.WebDriverException一起崩溃:消息:newSession的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆