selenium3.0.1调用firefox
报错信息如下时:
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.
这是因为在Firefox高版本需要使用 geckodriver 来驱动,不再使用Seleniu默认自带的Firefox webdriver。
我们只需要在下面这个地址下载 geckodriver 并将 其所在的路径设为环境变量即可解决。
https://github.com/mozilla/geckodriver/releases
当报如下错误信息时,则是
selenium.common.exceptions.WebDriverException: Message: Expected browser binary location, but unable to find binary in default location,
no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line
这时我们需要指定Firefox浏览器程序路径。
binary = FirefoxBinary('D:\\Firefox\\Firefox\\firefox.exe')
driver = webdriver.Firefox(firefox_binary=binary)
注:提示找不到"firefoxBinary"可以通过下面语句导入 from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
这样就能正常使用了。
另一个处理办法是将firefox的安装路径,直接增加到 python35\Lib\site-packages\selenium\webdriver\firefox 目录下的 firefox_binary.py文件中,如下图所示,然后driver = webdriver.Firefox()调用
selenium3.0.1调用firefox的更多相关文章
- selenium3.0不兼容火狐的解决方案
当直接调用火狐出现不兼容错误时,如何解决? 详看Message中提示:Expected browser binary location,but unable to find binary in def ...
- Selenium3.0 自动化测试
早在2013年的时候,Selenium官方宣布,Selenium新的版本会在圣诞节的时候发布.但是,他们并没有说哪一个圣诞节发布. 转眼的三年过去了,目前已经发布到Selenium3.0 beta4版 ...
- 『心善渊』Selenium3.0基础 — 1、Selenium自动化测试框架介绍
目录 1.Selenium介绍 2.Selenium的特点 3.Selenium版本说明 4.拓展:WebDriver与Selenium RC的区别 5.Webdriver工作原理 1.Seleniu ...
- 1 selenium3.0.1无法打开火狐浏览器
[问题描述] 1.配置selenium3.0和java后,尝试打开火狐浏览器,提示缺少geckodriver驱动. [解决方案] 1.在http://www.seleniumhq.org/downlo ...
- Selenium2+python自动化2-pip降级selenium3.0
selenium版本安装后启动Firefox出现异常:'geckodriver' executable needs to be in PATH selenium默默的升级到了3.0,然而网上的教程都是 ...
- Selenium+Python浏览器调用:Firefox
如何查看python selenium的API python -m pydoc -p 4567 说明: python -m pydoc表示打开pydoc模块,pydoc是查看python文档的首选工 ...
- 1.2 pip降级selenium3.0
1.2 pip降级selenium3.0 selenium版本安装后启动Firefox出现异常:'geckodriver' executable needs to be in PATHselenium ...
- 【基础】火狐和谷歌在Selenium3.0上的启动(二)
参考地址:http://www.cnblogs.com/fnng/p/5932224.html https://github.com/mozilla/geckodriver [火狐浏览器] 火狐浏览器 ...
- Selenium2学习(一)-pip降级selenium3.0
selenium版本安装后启动Firefox出现异常:'geckodriver' executable needs to be in PATH selenium默默的升级到了3.0,然而网上的教程都是 ...
随机推荐
- Python之路,day10-Python基础
一.进程进程:一个程序要运行时所需的所有资源的集合 进程是资源的集合,相当于一个车间 一个进程至少需要一个线程,这个线程为主线程 一个进程里可以有多个线程 cpu cores越多,代表着你可以真正并发 ...
- 如何解决CDR x8安装时显示“已停止工作”
相信很多朋友在安装cdr X8时会遇到这样一种情况,能装上去,但不能运行,弹出提示说CorelDRAW X8(64-bit)已停止工作.同样的X8安装包,在不同的电脑上测试有的没有问题,有的则会出现以 ...
- 安卓,支付宝app登录时,提示 服务器安全证书已过期或不可信任,请问怎么解决
安卓,支付宝app登录时,提示 服务器安全证书已过期或不可信任,请问怎么解决 请把手机时间调成当前时间.
- Java基础--serialVersionUID
Java基础--serialVersionUID serialVersionUID作用: 序列化时为了保持版本的兼容性,即在版本升级时反序列化仍保持对象的唯一性.有两种生成方式: 一个是默认的1L,比 ...
- Using dojo/query(翻译)
In this tutorial, we will learn about DOM querying and how the dojo/query module allows you to easil ...
- Markdown 软件
<<github.css>> Markdown 软件 :Typora / Haroopad / Markdownpad2 Markdownpad2软件注册及下载地址 邮箱地址: ...
- win 8 安装 NET framework3.5 方法
win 8 预装的 NET framework 是 4.5 的,实际上很多程序要求的是 3.5,一般要另从网上下载的才能安装. 这里提供不需要从网上安装 .Net 3.5 的方法: 1.将 win 8 ...
- ios7 ios8 cell中下划线偏移(separator Insets)处理方法
在ios7中,UITableViewCell左侧会有默认15像素的空白.这时候,设置setSeparatorInset:UIEdgeInsetsZero 能将空白去掉. 但是在ios8中,设置setS ...
- android-8~23 View.java - dispatchTouchEvent源码
android-8 /** * Pass the touch screen motion event down to the target view, or this * view if it is ...
- udacity google deep learning 学习笔记
1.为什么要在卷积网络中加入pooling(池化) 如果只利用卷积操作来减少feature map的大小,会失去很多信息.所以想到一种方法,减小卷积时的stride,留下大部分信息,通过池化来减小fe ...