安装了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

  1. 下载地址:https://github.com/mozilla/geckodriver/releases,根据自己的电脑,下载的win64位的;
  2. 在firefox的安装目录下,解压geckodriver,然后将该路径添加到path环境变量下,不报这个错了;
  3. 但是,报了一个新的错“selenium.common.exceptions.WebDriverException: Message: Unable to find a matching set of capabilities”;
  4. 继续网上查,原因是,我下载的geckodriver是V0.16.1版本的,这个版本和selenium3.4.2不兼容,需要使用deckdriverV0.15的版本;
  5. 重新下载了deckodriverV0.15的版本,ok了,不报这个错了,但是,又报了一个新的错“selenium.common.exceptions.WebDriverException: Message: Unsupported Marionette protocol version 2, required 3;
  6. 继续往上查原因,说是firefox版本太低了,需要升级到最新版,ok,更新firefox,问题解决。\
  7. 火狐浏览器的安装文件.exe也添加到path环境变量中,避免出现一些不不要的错误

python无法启动火狐浏览器且报错“selenium.common.exceptions.WebDriverException: Message: Unable to find a matching set of capabilities”的更多相关文章

  1. 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: ...

  2. 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 ...

  3. selenium使用报错“selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.”

    安装了python3,使用pip安装了selenium,但是在使用时,报了“selenium.common.exceptions.WebDriverException: Message: 'gecko ...

  4. 【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个区域的安全保护模式

  5. 【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 ...

  6. python+selenium,打开浏览器时报selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH

    有一年多没写web自动化了,今天搭建环境的时候报了一个常见错误,但是处理过程有点闹心,报错就是常见的找不到驱动<selenium.common.exceptions.WebDriverExcep ...

  7. Selenium click不生效 报错selenium.common.exceptions.InvalidArgumentException

    记录在使用selenium过程中踩的坑------ 在使用selenium时,用click点击网站弹出的文件上传框的"上传文件"按钮不生效,报错selenium.common.ex ...

  8. appium常见问题03_appium脚本报错selenium.common.exceptions.WebDriverException

    运行appium脚本时报错selenium.common.exceptions.WebDriverException...,如下截图: 该报错说明appium和app的内置chrome版本不一致 [解 ...

  9. python+selenium遇到元素定位不到的问题,顺便记录一下自己这次的错误(报错selenium.common.exceptions.NoSuchElementException)

    今天在写selenium一个发送邮件脚本时,遇到一些没有找到页面元素的错误.经过自己反复调试,找原因百度,终于解决了.简单总结一下吧,原因有以下几点: 一:Frame控件嵌套,.Frame/Ifram ...

随机推荐

  1. thinkphp 自动完成

    自动完成是ThinkPHP提供用来完成数据自动处理和过滤的方法,使用create方法创建数据对象的时候会自动完成数据处理. 因此,在ThinkPHP使用create方法来创建数据对象是更加安全的方式, ...

  2. 使用 SourceTree 操作时弹出 password required

    通过 https 的方式克隆仓库的,SourceTree 推送等操作的时候会弹出提示要求输入密码. 在仓库里面设置: 远程仓库-选中仓库-点击编辑-修改 url 路径, 路径格式,以码云为例: htt ...

  3. 学而有道--思维导图式总结(一):Nosql分类

    前言: 众所周知,学习是需要方法的.作为一名java程序员,我们需要学习无数的技能,然而我们的大脑并不买账,学习了一项知识,时间一久就会遗忘, 如何更好高效的回忆起曾经学习过的知识,是极其重要的. 有 ...

  4. Nginx简介与基础配置

    何为Nginx? Nginx ("engine x") 是一个高性能的HTTP和反向代理服务器,也是一个IMAP/POP3/SMTP服务器.最初是为了解决C10k的问题,由Igor ...

  5. 大数据处理也要安全--关于MaxCompute的安全科普

    [TOC] 1.企业大数据处理现状 当今社会数据收集手段不断丰富,行业数据大量积累,数据规模已增长到了传统软件行业无法承载的海量数据(百GB.TB乃至PB)级别.基于此,阿里云推出有了一套快速.完全托 ...

  6. watch、tail联合使用

    因为用了tmux,不想调整窗格大小,只想输出命令结果的最后几行,所以就想出了这个方法. watch.tail联合用法 watch 'echo "`nvidia-smi`" | ta ...

  7. 大牛就别进来了.npm --save-dev --save 的区别

    --save-dev 是你开发时候依赖的东西,--save 是你发布之后还依赖的东西. 比如,你写 ES6 代码,如果你想编译成 ES5 发布那么 babel 就是devDependencies.如果 ...

  8. 页面跳转不带 referrer的方法

    如果页面中包含了如下 meta 标签,所有从当前页面中发起的请求将不会携带 referer: <meta name="referrer" content="neve ...

  9. 19-10-18-Y

    ZJ一下: 感觉能拿到的分都拿到了,至于后来改题就缶了 其实是:太tui导致没改好 TJ: T1: 正解是$\mathsf{KMP}$,但是广大群众都用了$\mathsf{hash}$…… 发现了一个 ...

  10. CentOS7.4 安装JDK 步骤

    1.先在官网下载jdk1.8的压缩文件 2.用putty将压缩文件拷到home目录下 3.新建一个/home/jdk1.8目录 :  mkdir  /home/jdk1.8 4.将压缩文件解压到hom ...