python无法启动火狐浏览器且报错“selenium.common.exceptions.WebDriverException: Message: Unable to find a matching set of capabilities”
安装了python2,使用pip安装了selenium,但是在使用时,报了“selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.”
网上查了一下解决办法,此处做下记录:
原因:使用pip安装selenium,默认安装的是最新版本的selenium,使用pip list查了一下我的selenium版本,是3.5.0的,firefox版本,是47.0.2的,selenium 3.x开始,webdriver/firefox/webdriver.py的__init__中,executable_path="geckodriver";而2.x是executable_path="wires"
方法一:可以卸载现有的selenium,安装指定的2.X版本的selenium,这个办法没有试,因为就是本着selenium3来的,不打算降版本;
方法二:下载geckodriver.exe
- 下载地址:https://github.com/mozilla/geckodriver/releases,根据自己的电脑,下载的win64位的;
- 在firefox的安装目录下,解压geckodriver,然后将该路径添加到path环境变量下,不报这个错了;
- 但是,报了一个新的错“selenium.common.exceptions.WebDriverException: Message: Unable to find a matching set of capabilities”;
- 继续网上查,原因是,我下载的geckodriver是V0.16.1版本的,这个版本和selenium3.4.2不兼容,需要使用deckdriverV0.15的版本;
- 重新下载了deckodriverV0.15的版本,ok了,不报这个错了,但是,又报了一个新的错“selenium.common.exceptions.WebDriverException: Message: Unsupported Marionette protocol version 2, required 3;
- 继续往上查原因,说是firefox版本太低了,需要升级到最新版,ok,更新firefox,问题解决。\
- 火狐浏览器的安装文件.exe也添加到path环境变量中,避免出现一些不不要的错误
python无法启动火狐浏览器且报错“selenium.common.exceptions.WebDriverException: Message: Unable to find a matching set of capabilities”的更多相关文章
- robotframework执行用例时,报错selenium.common.exceptions.WebDriverException: Message: unknown error: cannot get automation extension from unknown error: page could not be found: chrome-extension://aapnijgdinl
在用robotframework编写移动端测试用例(用chrome浏览器模拟手机浏览器),执行用例时, 报错selenium.common.exceptions.WebDriverException: ...
- windows下使用selenium报错selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH
问题 :执行程序代码报错: WebDriverException:Message:'geckodriver'executable needs to be in Path 或者 selenium.com ...
- selenium使用报错“selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.”
安装了python3,使用pip安装了selenium,但是在使用时,报了“selenium.common.exceptions.WebDriverException: Message: 'gecko ...
- 【Selenium】【BugList6】调用IE,未启用保护模式,报:selenium.common.exceptions.WebDriverException: Message: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones.
>>> driver = webdriver.Ie() 解决方法: 1.打开Ie浏览器 , 工具 ->Internet选项 ->安全 2.去掉4个区域的安全保护模式
- 【Python + Selenium】初次用IE浏览器之报错:selenium.common.exceptions.WebDriverException: Message: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones.
初次用IE浏览器运行自动化程序时,报错:selenium.common.exceptions.WebDriverException: Message: Unexpected error launchi ...
- python+selenium,打开浏览器时报selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH
有一年多没写web自动化了,今天搭建环境的时候报了一个常见错误,但是处理过程有点闹心,报错就是常见的找不到驱动<selenium.common.exceptions.WebDriverExcep ...
- Selenium click不生效 报错selenium.common.exceptions.InvalidArgumentException
记录在使用selenium过程中踩的坑------ 在使用selenium时,用click点击网站弹出的文件上传框的"上传文件"按钮不生效,报错selenium.common.ex ...
- appium常见问题03_appium脚本报错selenium.common.exceptions.WebDriverException
运行appium脚本时报错selenium.common.exceptions.WebDriverException...,如下截图: 该报错说明appium和app的内置chrome版本不一致 [解 ...
- python+selenium遇到元素定位不到的问题,顺便记录一下自己这次的错误(报错selenium.common.exceptions.NoSuchElementException)
今天在写selenium一个发送邮件脚本时,遇到一些没有找到页面元素的错误.经过自己反复调试,找原因百度,终于解决了.简单总结一下吧,原因有以下几点: 一:Frame控件嵌套,.Frame/Ifram ...
随机推荐
- 记录一次dubbo不能正常抛出特定异常
BUG场景 今天同事的代码中出现一个问题,让我帮忙排查一下.原代码大致如下 dubbo服务消费者: @Resource private IPayWayService payWayService; @R ...
- php日期
PHP Date() 函数 PHP date() 函数用于格式化时间/日期. 该函数可把时间戳格式化为可读性更好的日期和时间. 时间戳是一个字符序列,表示一定的事件发生的日期/时间. 语法 date( ...
- Online开发初体验——Jeecg-Boot 在线配置图表
Online开发——初体验(在线配置图表) 01 通过JSON数据,快速配置图形报表 02 通过SQL数据,快速配置图形报表 03 图表模板配置,实现不同数据源图表合并展示 04 图表布局,支持单排. ...
- if __name__=='__main__'使用场景,彻底明白
本博中有一篇文章写了 if __name__=='__main__'的作用与原理http://www.cnblogs.com/fennudexiaoniao/p/7458324.html,但是好像似懂 ...
- sed awk 练习
#定位到某一行 添加内容 lower_case_flag=`cat /etc/my.cnf|grep "^lower_case_table_names"` if [ "X ...
- Selenium浏览器自动化测试使用(2)
Selenium - 环境安装设置 为了开发Selenium RC或webdriver脚本,用户必须确保他们有初始配置完成.有很多关联建立环境的步骤.这里将通过详细的讲解. 下载并安装Java 下载并 ...
- extern关键字及C\C++相互调用
extern关键字主要修饰变量或函数,表示该函数可以跨文件访问,或者表明该变量在其他文件定义,在此处引用. 1.extern修饰变量 (1)如果某变量int m在a.c中定义声明,则其他b.c文件访问 ...
- RN 开发工具及发布release版本
2.1.开发工具推荐visual studio code https://code.visualstudio.com/docs/?dv=win 选择安装react native tool 就可以了 2 ...
- Django项目:CRM(客户关系管理系统)--63--53PerfectCRM实现CRM客户报名流程缴费
#urls.py """PerfectCRM URL Configuration The `urlpatterns` list routes URLs to views. ...
- 2018-2019-2-20175332-实验四《Android程序设计》实验报告
一.Android Stuidio的安装测试 题目要求: 参考http://www.cnblogs.com/rocedu/p/6371315.html#SECANDROID,安装 Android St ...