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 ...
随机推荐
- exgcd证明和最基础应用
如何求解这个方程:\(ax + by = gcd (a, b)\)? \(∵gcd(a, b) = gcd (b, a \% b)\) \(∴\)易证 $ gcd(a, b)$ 总是可以化为 \(gc ...
- spark常见异常汇总
spark常见异常汇总 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 温馨提示: 如果开发运行spark出现问题啦,可能需要运维这边做一些调优,也可能是开发那边需要修改代码.到 ...
- JAVA核心技术I---JAVA基础知识(数据类型)
一:基本类型 –boolean 布尔 –byte 字节 –short/int/long 短整数/整数/长整数 –float/double 浮点数 –char 字符 (一)boolean 只有true, ...
- Linux记录-salt分析
salt-master建立分组 如dn: 'L@dnxxx,dyyy' salt -N dn state.apply hadoop test=true salt -N dn cmd.run ' ...
- Part-Six
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12.
- 让overflow:auto页面滚动条出现时不跳动
今天看到一篇张鑫旭的文章,转载过来.https://www.zhangxinxu.com/wordpress/2015/01/css-page-scrollbar-toggle-center-no-j ...
- C#正则表达式匹配
1.匹配所有带括号的字符串 string s = "aaaa(bbb)ccc(ddd)eeee"; string pattern = "\\(\\w+\\)"; ...
- 20155324 2016-2017-2 《Java程序设计》第9周学习总结
20155324 2016-2017-2 <Java程序设计>第9周学习总结 教材学习内容总结 学习目标 了解JDBC架构 掌握JDBC架构 掌握反射与ClassLoader 了解自定义泛 ...
- file_list(path):遍历文件列表[python]
import os def __file_list__(path, level): files = os.listdir(path); for i in files: path_tmp = path ...
- Understanding a project which include NodeJS, Webpack, Vue
公司有一个web 项目是用 Vue 写的, 前段时间负责这个tool的人离职了没有人维护,其他人又很忙,我就去看了一下以便以后能加一些新功能在上面 没有接触过Vue, 这些理解了一下关系做一些学习记录 ...