python中用selenium调Firefox报错问题
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报错问题的更多相关文章
- 7.解决在python中用selenium启动FireFox浏览器启动不了的方法
首次在利用python中的selenium启动FireFox浏览器时可能碰到如下问题 当输入如下代码时: from selenium import webdriver brower=webdriver ...
- python脚本中selenium启动浏览器报错os.path.basename(self.path), self.start_error_message) selenium.common.excep
在python脚本中,使用selenium启动浏览器报错,原因是未安装浏览器驱动,报错内容如下: # -*- coding:utf-8 -*-from selenium import webdrive ...
- 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 ...
- 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 ...
- selenium执行js报错
selenium执行js报错 Traceback (most recent call last): dr.execute_script(js) File "C:\Python27\l ...
- 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 ...
- python安装包的时候报错
python安装包的时候报错 今天兴致勃勃的安装了一个paramiko包,过程很顺利,但是到结尾的时候报错,这就让人不爽了. 所以呢,需要安装一个名为python-dev的软件包. 该软件包包括头文件 ...
- Python爬虫之selenium各种注意报错
刚刚写完第一个selenuim+BeautifulSoup实战爬虫 爬淘宝.发现代码写完后不加for 翻页的时候没什么问题 解析 操作 都没问题 也就是说第一页 的内容 完好 pagebtn=wait ...
- PyCharm+selenium环境搭建报错:Traceback (most recent call last): TypeError: 'module' object is not callable
环境搭建好后,代码如下: from selenium import webdriverdriver = webdriver.chrome()driver.get("http://www.ba ...
随机推荐
- 干货分享:互联网运营 学习SEO从零开始 SEO深度解析学习笔记
最近在自学SEO,互联网运营,把做的笔记干货分享给大家啊! 希望能帮到大家,如有好的建议可以关注我[磨人的小妖精]或留言,大家一起探讨. 之前还写过一篇文章互联网运营+SEO:推荐必看的5本书籍,学习 ...
- python bytes类型去除尾部字节
by = b'\x01\x02' print(by) by = by.rstrip() print(by) by = by.rstrip(chr(2).encode()) print(by) b'\x ...
- jmeter jsr223脚本引用变量的问题
发现jmeter的一个问题不知道算不算bug. 具体表现为,在脚本中通过"${varName}"的方式引用前面使用vars.put("varName",&quo ...
- ansible基础-ansible角色的使用
ansible基础-ansible角色的使用 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 我们建议把多个节点都会用到的功能将其定义模块,然后谁要用到该模块就直接调用即可!而在a ...
- Java Web之EL
<%-- Created by IntelliJ IDEA. User: Vae Date: 2019/1/2 Time: 12:19 To change this template use F ...
- jquery validate 详解一
原文:http://blog.sina.com.cn/s/blog_608475eb0100h3h1.html jQuery校验官网地址:http://bassistance.de/jquery-pl ...
- 056、macvlan网络结构分析(2019-03-25 周一)
参考https://www.cnblogs.com/CloudMan6/p/7383919.html macvlan不依赖linux bridge brctl show 可以确认没有创建新的b ...
- 完全使用UDP登录Linux
===============Mosh 登录器========================================= == 针对TCP被某些防火墙阻断的Linux机器, 该程序可以让你不使 ...
- Android获取版本号
public static String getVersionName(Context context) { PackageManager manager = context.getPackageMa ...
- C# UserControl集合属性使用
在UserControl中,定义集合属性时,如果直接使用List是检测不到在属性框中的列表修改变化的,可以通过 ObservableCollection() 实现 1.定义类 [Serializabl ...