首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用Firefox运行Selenium文档示例时出错

问使用Firefox运行Selenium文档示例时出错
EN

Stack Overflow用户
提问于 2015-09-16 15:37:15
回答 1查看 190关注 0票数 0

我对编程非常陌生,最近学了一点python。作为我的项目的一部分,我需要打开,提供一个网页表单和下载一个图像,因为我必须做无数次,我看了看是否有任何方法可以使用Python自动化它。我刚刚在它的文档中运行了这个例子,在使用firefox时遇到了一些问题。

我得到一个很大的错误,如下所示:

代码语言:javascript
复制
 driver = webdriver.Firefox()
  File "/usr/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py", line 51, in __init__
    self.binary, timeout),
  File "/usr/lib/python2.7/dist-packages/selenium/webdriver/firefox/extension_connection.py", line 47, in __init__
    self.binary.launch_browser(self.profile)
  File "/usr/lib/python2.7/dist-packages/selenium/webdriver/firefox/firefox_binary.py", line 44, in launch_browser
    self._wait_until_connectable()
  File "/usr/lib/python2.7/dist-packages/selenium/webdriver/firefox/firefox_binary.py", line 81, in _wait_until_connectable
    self._get_firefox_output())
selenium.common.exceptions.WebDriverException: Message: 'The browser appears to have exited before we could connect. 

我怎么才能绕过这个。我使用的是python 2.7.6,Firefox版本是40.0.3

EN

回答 1

Stack Overflow用户

发布于 2015-09-16 16:26:59

Selenium v2.25不支持火狐v40。可以降级浏览器,也可以升级selenium版本。

  • Selenium v2.25支持火狐浏览器v17。
  • Selenium v2.47支持火狐浏览器v39。

Check this page for more details on changelog。希望这能有所帮助。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32602447

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档