Python Selenium 启动新版本Firefox失败问题解决方案
2016-11-17 17:59
555 查看
Firefox 45版本以上使用selenium-3.0.1无法直接启动需要如下步骤:
(1) 下载geckodriver.exe
https://github.com/mozilla/geckodriver/releases
解压后放置到
1.查看C:\Python27\Lib\site-packages\selenium\webdriver\firefox中的webdriver.py,在def_init_函数中,executable_path="geckodriver",之前搭建的环境上是executable_path="wires";
2.geckodriver是一原生态的第三方浏览器,对于selenium3.x版本都会使用geckodriver来驱动firefox,所以需要下载geckodriver.exe,下载地址:https://github.com/mozilla/geckodriver/releases
3.放在C:\Python27(查看环境变量path中是否添加C:\Python27该路径)、
(2)
from selenium import webdriver
fromselenium.webdriver.common.desired_capabilities import DesiredCapabilities
fromselenium.webdriver.firefox.firefox_binary import FirefoxBinary
binary = FirefoxBinary(r'C:\ProgramFiles (x86)\Mozilla Firefox\firefox.exe')
driver =webdriver.Firefox(firefox_binary=binary)
driver.get('http://www.google.com')
Firefox 45版本以上使用selenium-3.0.1无法直接启动需要如下步骤:
(1) 下载geckodriver.exe
https://github.com/mozilla/geckodriver/releases
解压后放置到
1.查看C:\Python27\Lib\site-packages\selenium\webdriver\firefox中的webdriver.py,在def_init_函数中,executable_path="geckodriver",之前搭建的环境上是executable_path="wires";
2.geckodriver是一原生态的第三方浏览器,对于selenium3.x版本都会使用geckodriver来驱动firefox,所以需要下载geckodriver.exe,下载地址:https://github.com/mozilla/geckodriver/releases
3.放在C:\Python27(查看环境变量path中是否添加C:\Python27该路径)、
(2)
from selenium import webdriver
fromselenium.webdriver.common.desired_capabilities import DesiredCapabilities
fromselenium.webdriver.firefox.firefox_binary import FirefoxBinary
binary = FirefoxBinary(r'C:\ProgramFiles (x86)\Mozilla Firefox\firefox.exe')
driver =webdriver.Firefox(firefox_binary=binary)
driver.get('http://www.google.com')
(1) 下载geckodriver.exe
https://github.com/mozilla/geckodriver/releases
解压后放置到
1.查看C:\Python27\Lib\site-packages\selenium\webdriver\firefox中的webdriver.py,在def_init_函数中,executable_path="geckodriver",之前搭建的环境上是executable_path="wires";
2.geckodriver是一原生态的第三方浏览器,对于selenium3.x版本都会使用geckodriver来驱动firefox,所以需要下载geckodriver.exe,下载地址:https://github.com/mozilla/geckodriver/releases
3.放在C:\Python27(查看环境变量path中是否添加C:\Python27该路径)、
(2)
from selenium import webdriver
fromselenium.webdriver.common.desired_capabilities import DesiredCapabilities
fromselenium.webdriver.firefox.firefox_binary import FirefoxBinary
binary = FirefoxBinary(r'C:\ProgramFiles (x86)\Mozilla Firefox\firefox.exe')
driver =webdriver.Firefox(firefox_binary=binary)
driver.get('http://www.google.com')
Firefox 45版本以上使用selenium-3.0.1无法直接启动需要如下步骤:
(1) 下载geckodriver.exe
https://github.com/mozilla/geckodriver/releases
解压后放置到
1.查看C:\Python27\Lib\site-packages\selenium\webdriver\firefox中的webdriver.py,在def_init_函数中,executable_path="geckodriver",之前搭建的环境上是executable_path="wires";
2.geckodriver是一原生态的第三方浏览器,对于selenium3.x版本都会使用geckodriver来驱动firefox,所以需要下载geckodriver.exe,下载地址:https://github.com/mozilla/geckodriver/releases
3.放在C:\Python27(查看环境变量path中是否添加C:\Python27该路径)、
(2)
from selenium import webdriver
fromselenium.webdriver.common.desired_capabilities import DesiredCapabilities
fromselenium.webdriver.firefox.firefox_binary import FirefoxBinary
binary = FirefoxBinary(r'C:\ProgramFiles (x86)\Mozilla Firefox\firefox.exe')
driver =webdriver.Firefox(firefox_binary=binary)
driver.get('http://www.google.com')
相关文章推荐
- Python Selenium 启动新版本Firefox失败问题解决方案
- Python Selenium 启动新版本Firefox失败问题解决方案
- 解决python selenium3启动不了firefox的问题
- python selenium3启动不了firefox的解决办法
- Python-Selenium2做Web自动化测试(6)-解决使用Webdrive打开Firefox不含有插件的问题
- Python-selenium-Firefox-chrome-IE问题解决方法
- python selenium启动不了火狐浏览器(firefox)的解决办法
- python爬虫,selenium使用,Firefox-chrome-IE问题解决方法,selenium的基本操作
- 解决selenium-RC无法启动firefox浏览器进行java测试脚本的问题
- (selenium 小知识点)解决使用Webdrive打开Firefox不含有插件的问题(python)
- Python-selenium-Firefox-chrome-IE问题解决方法
- Android ADB 启动失败,端口占用问题解决方案
- 彻底解决selenium启动firefox时总弹框的问题
- Selenium-解决使用Webdrive打开Firefox不含有插件的问题(python)
- docker中mysql初始化及启动失败问题解决方案
- 访问 IIS 元数据库失败 或 W3SVC 的访问权问题解决方法 或 无法在Web服务器上启动调试
- Struts2中文件过大上传失败问题解决方案
- Firefox启动慢等问题解决办法
- Firefox启动慢等问题解决办法
- 关于IIS服务启动失败的问题:“IIS提示‘另一个程序正在使用此文件,进程无法访问’”,的解决方法