python在用selenium调Firefox时报错:

Traceback (most recent call last):
  File "G:\python_work\chapter11\test_selenium_firefox.py", line 10, in <module>
    driver = webdriver.Firefox()
  File "C:\Python34\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 154, in __init__
    keep_alive=True)
  File "C:\Python34\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 140, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "C:\Python34\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 229, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "C:\Python34\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 297, in execute
    self.error_handler.check_response(response)
  File "C:\Python34\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 194, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Unable to find a matching set of capabilities

=============================

python版本3.4.3 , selenium版本3.4.3 , Firefox版本49.0.

报错的原因是python, selenium, Firefox之间的版本兼容问题 , 将Firefox升级到最新版55.0后问题解决.

同时selenium在调用Firefox时需要geckodriver , 下载后添加到Firefox安装目录, 同时添加Firefox安装目录到系统环境变量Path.

=============================

测试代码:

 from selenium import webdriver

 driver = webdriver.Firefox()
driver.get("http://www.baidu.com")

python中用selenium调Firefox报错问题的更多相关文章

  1. 7.解决在python中用selenium启动FireFox浏览器启动不了的方法

    首次在利用python中的selenium启动FireFox浏览器时可能碰到如下问题 当输入如下代码时: from selenium import webdriver brower=webdriver ...

  2. python脚本中selenium启动浏览器报错os.path.basename(self.path), self.start_error_message) selenium.common.excep

    在python脚本中,使用selenium启动浏览器报错,原因是未安装浏览器驱动,报错内容如下: # -*- coding:utf-8 -*-from selenium import webdrive ...

  3. Selenium Grid 运行报错 Exception thrown in Navigator.Start first time ->Error forwarding the new session Empty pool of VM for setup Capabilities

    Selenium Grid 运行报错 : Exception thrown in Navigator.Start first time ->Error forwarding the new se ...

  4. python2.7运行selenium webdriver api报错Unable to find a matching set of capabilities

    在火狐浏览器33版本,python2.7运行selenium webdriver api报错:SessionNotCreatedException: Message: Unable to find a ...

  5. selenium执行js报错

    selenium执行js报错 Traceback (most recent call last):    dr.execute_script(js)  File "C:\Python27\l ...

  6. Python读取CSV文件,报错:UnicodeDecodeError: 'gbk' codec can't decode byte 0xa7 in position 727: illegal multibyte sequence

    Python读取CSV文件,报错:UnicodeDecodeError: 'gbk' codec can't decode byte 0xa7 in position 727: illegal mul ...

  7. python安装包的时候报错

    python安装包的时候报错 今天兴致勃勃的安装了一个paramiko包,过程很顺利,但是到结尾的时候报错,这就让人不爽了. 所以呢,需要安装一个名为python-dev的软件包. 该软件包包括头文件 ...

  8. Python爬虫之selenium各种注意报错

    刚刚写完第一个selenuim+BeautifulSoup实战爬虫 爬淘宝.发现代码写完后不加for 翻页的时候没什么问题 解析 操作 都没问题 也就是说第一页 的内容 完好 pagebtn=wait ...

  9. PyCharm+selenium环境搭建报错:Traceback (most recent call last): TypeError: 'module' object is not callable

    环境搭建好后,代码如下: from selenium import webdriverdriver = webdriver.chrome()driver.get("http://www.ba ...

随机推荐

  1. tar压缩解压文件

    查看visualization1.5.tar.gz 压缩包里面的内容: $ tar -tf visualization1.5.tar.gz 解压指定文件JavascriptVisualRelease/ ...

  2. 《Java 程序设计》第一周学习总结

    本周因为刚刚接触Linux和码云等等,所以在完成作业的时候遇到很多问题. 首先,在安装Linux没有安装盘片,在盘片安装之后成功建立虚拟机,建立虚拟机后首先要下载jdk,第一次下载时没有选对格式,Li ...

  3. bind,apply,call,caller,callee还傻傻分不清楚?

    先介绍每个的语法: 1. bind() 语法:fn.bind(thisObj[, arg1[, arg2[, ...]]]) fn:是想要改变this指向的函数 thisObj:表示fn中this指针 ...

  4. python3: 爬虫---- urllib, beautifulsoup

    最近晚上学习爬虫,首先从基本的开始: python3 将urllib,urllib2集成到urllib中了, urllib可以对指定的网页进行请求下载,  beautifulsoup 可以从杂乱的ht ...

  5. CentOS6.9快速安装配置svn

    CentOS6.9快速安装配置svn 环境介绍: 操作系统:CentOS release 6.9 (Final)192.168.65.130 (svn服务器)192.168.65.129 (svn客户 ...

  6. elasticsearch 集成springboot

    和jpa类似,很简单,很强大. pom <dependencies> <dependency> <groupId>org.springframework.boot& ...

  7. Dubbo简易控制中心安装

    1. zookeeper安装(单机版):http://www.cnblogs.com/wangfajun/p/5251159.html  √ 2. dubbo管控台安装(zookeeper单机版):h ...

  8. Kafka技术内幕 读书笔记之(三) 生产者——消费者:高级API和低级API——基础知识

    1. 使用消费组实现消息队列的两种模式 分布式的消息系统Kafka支持多个生产者和多个消费者,生产者可以将消息发布到集群中不同节点的不同分区上:消费者也可以消费集群中多个节点的多个分区上的消息 . 写 ...

  9. C#设计模式(12)——组合模式

    1.组合模式 在软件开发中我们经常会遇到处理部分与整体的情况,如我们经常见到的树形菜单,一个菜单项的子节点可以指向具体的内容,也可以是子菜单.类似的情况还有文件夹,文件夹的下级可以是文件夹也可以是文件 ...

  10. js拼接HTML页面元素a标签遇到的问题

    业务,如下图需要做一个广告轮播的图片链接 使用了ajax请求后台,在js拼接html,关键代码: $("#scroll_img").html(""); for ...