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. slider插件制作轮播图

    html代码: <div id="banner_tabs" class="flexslider"> <ul class="slide ...

  2. 11:12:21.924 [main] DEBUG org.apache.ibatis.logging.LogFactory - Logging initialized using 'class org.apache.ibatis.logging.slf4j.Slf4jImpl' adapter.

    11:12:21.924 [main] DEBUG org.apache.ibatis.logging.LogFactory - Logging initialized using 'class or ...

  3. JavaFX 简介

    JavaFX 介绍一提到Java的图形界面库,我们通常听到的都是Swing,或者更老一点的AWT,包括很多书上面介绍的也都是这两种.很多学校.培训班教学的也是这两种技术.但是其实这两种技术都已经过时很 ...

  4. python Bootstarp框架和inconfont、font-awesome使用

    http://www.bootcss.com/ http://www.runoob.com/bootstrap/bootstrap-panels.html  查找基本的没问题 https://www. ...

  5. 13个.Net开源的网络爬虫

    请点击此处输入图片描述 1:.Net开源的跨平台爬虫框架 DotnetSpider Star:430 DotnetSpider这是国人开源的一个跨平台.高性能.轻量级的爬虫软件,采用 C# 开发.目前 ...

  6. eDEX-UI

    eDEX-UI A science fiction terminal emulator disigned for large touchscreen that runs on all major OS ...

  7. 062、如何使用flannel host-gw backend(2019-04-02 周二)

    参考https://www.cnblogs.com/CloudMan6/p/7457653.html   flannel 支持多种backend,前面学习的是 vxlan backend ,host- ...

  8. Python3快速入门

    ——<趣学Python-教孩子学编程>学习笔记 1.注释 (1)单行注释以  #  开头注释 # 这是一个注释 print("Hello, World!") (2)多行 ...

  9. GCC编译器原理(一)04------GCC 工具:nlmconv、nm、objcopy、objdump和 ranlib

    1.3.13 nlmconv nlmconv 将可重定位的对象文件(Infile)转换为 NetWare 可加载模块(outfile),并可选择读取头文件信息获取 NLM 头信息. 选项,描述 -I ...

  10. 三、文件IO——系统调用(续)

    3.2.4 read 函数--- 读文件 read(由已打开的文件读取数据) #include<unistd.h> ssize_t read(int fd, void * buf, siz ...