selenium firefox驱动_Python3+selenium配置常见报错解决方案
第一个报错问题
'geckodriver' executable needs to be in PATH
1.1如果启动浏览器过程中报如下错误:
Traceback (most recent call last):File "", line 1, in <module>File "D:\test\python3\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 145, in __init__self.service.start()File "D:\test\python3\lib\site-packages\selenium\webdriver\common\service.py", line 81, in startos.path.basename(self.path), self.start_error_message)selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.
1.2这个是因为最新的selenium3.0启动firefox需要geckodriver.exe这个驱动文件。
1.3下载之后,配置到环境变量path下(可以直接放python根目录)
第二个报错问题
Expected browser binary location, but unable to find binary in default location
1.1如果启动浏览器过程中报如下错误:
Traceback (most recent call last):File "", line 1, in <module>File "D:\test\python3\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 155, in __init__keep_alive=True)File "D:\test\python3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 92, in __init__self.start_session(desired_capabilities, browser_profile)
File "D:\test\python3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 179, in start_sessionresponse = self.execute(Command.NEW_SESSION, capabilities)File "D:\test\python3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 238, in executeself.error_handler.check_response(response)File "D:\test\python3\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 193, in check_responseraise exception_class(message, screen, stacktrace)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.
1.2这个是因为firefox.exe这个文件也需要配置到环境变量path下
1.3这个路径就是安装完firefox后,找到firefox.exe这个文件的地址,加到path下
第三个报错问题
Unsupported Marionette protocol version 2, required 3
1.1如果启动浏览器过程中出现如下错误:
Traceback (most recent call last):File "", line 1, in <module>
File "D:\test\python3\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 155, in __init__keep_alive=True)File "D:\test\python3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 92, in __init__self.start_session(desired_capabilities, browser_profile)File "D:\test\python3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 179, in start_sessionresponse = self.execute(Command.NEW_SESSION, capabilities)File "D:\test\python3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 238, in executeself.error_handler.check_response(response)File "D:\test\python3\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 193, in check_response
raise exception_class(message, screen, stacktrace)selenium.common.exceptions.WebDriverException: Message: Unsupported Marionette protocol version 2, required 3
1.2这个错误原因是firefox版本过低了,最新的selenium3.0版本支持firefox47以上的版本,升级版本就可以了
第四个报错问题
WebDriverException: Message: newSession
1.1Traceback (most recent call last):
File “D:\test\python3\lib\site-packages\selenium\webdriver\firefox\\webdriver.py”, line 170, in initkeep_alive=True)File “D:\test\python3\lib\site-packages\selenium\webdriver\firefox\\webdriver.py”, line 156, in initself.start_session(capabilities, browser_profile)File “D:\test\python3\lib\site-packages\selenium\webdriver\firefox\\webdriver.py”, line 245, in start_sessionresponse = self.execute(Command.NEW_SESSION, parameters)File “D:\test\python3\lib\site-packages\selenium\webdriver\firefox\\webdriver.py”, line 314, in executeself.error_handler.check_response(response)File “D:\test\python3\lib\site-packages\selenium\webdriver\firefox\\errorhandler.py”, line 242, in check_responseraise exception_class(message, screen, stacktrace)selenium.common.exceptions.WebDriverException: Message: newSession
1.2下载最新的geckodriver.exe 然后把它放到python的安装目录下
本文版权归作者心安-lucky所有,欢迎转载,但未经作者同意必须保留此段声明,否则保留追究法律责任的权利。
专注当下 用心生活微信号:gml02030107喜欢就长按图片扫码关注吧
作者@心安-lucky
编辑@心安-lucky
图片@心安-lucky
selenium firefox驱动_Python3+selenium配置常见报错解决方案相关推荐
- python3 selenium ie 拒绝连接报错_Python3+selenium配置常见报错解决方案
第一个坑:'geckodriver' executable needs to be in PATH 1.如果启动浏览器过程中报如下错误 Traceback (most recent call last ...
- docker安装mysql及相关配置、运行细节和常见报错解决方案
安装.运行 需要特别注意-v挂载到本机的目录的权限问题,否则报错:ERROR 2002 (HY000): Can't connect to local MySQL server through soc ...
- mysql安装ZIP存档什么意思_关于MySQLzip安装常见报错解决方案!
首先,zip安装需要64位的系统,自己看电脑是不是32位的. 然后你的路径不要有中文,不要有中文,不要有中文!!! 名字也不要不要带空格,不要带空格,不要带空格!!!计算机会把空格前的名字默认为一个目 ...
- 超详细搭建个人网站教程,附带各种常见报错解决方案。
文章目录 前言 解惑环节 准备工作 环境配置 一.安装 二.环境配置 1.cnpm安装 2.Hexo安装 可能报错和问题: 博客初始化 1.博客搭建 可能报错和问题: 2.博客测试 可能报错和问题 主 ...
- 内置Jetty配置JSP支持过程中的常见报错
目录 1. 常见报错及解决 1.1 JSP support not configured 1.2 JSTL标签解析 1.3 JSP编译 1.4 JSP实现依赖 1.5 EL表达式支持 2. 小结 1. ...
- 配置hadoop集群常见报错汇总
配置hadoop集群常见报错汇总 1.使用hdfs namenode -format 格式化报错找不到JAVAHOME 该问题只需在对应的窗口导入JAVAHOME即可,注意,此处为对应环境安装的JDK ...
- 微信小程序根据坐标点解析地址常见报错:请求来源未被授权
功能需求 微信小程序提供的接口能够获取到当前位置的坐标(经纬度),但是不能得到当前位置的地址.或者从后台获取到坐标(经纬度)要解析成文字描述的地址小程序也没有对应的接口. 实现思路 这时候就需要通过腾 ...
- web报表工具FineReport使用中遇到的常见报错及解决办法(一)
FineReport使用中遇到的常见报错及解决办法(一) 这里写点抛砖引玉,希望大家能把自己整理的问题及解决方法晾出来,Mark一下,利人利己. 出现问题先搜一下文档上有没有,再看看度娘有没有,再看看 ...
- 【模拟器】华为模拟器eNSP安装注意事项及常见报错处理
华为eNSP模拟器:Enterprise Network Simulator Platform 简称ensp企业网络仿真平台华为公司自研的一款仿真软件,有利于大家学习华为相关网络技术. 01 安装eN ...
最新文章
- 掌握Angular2的服务(service)
- solidity mapping of mapping
- MySQL数据库的备份和还原
- 计算UILabel带行间距的行高
- 使用 Git Extensions 简单入门 Git
- 西安下雪了,做了一个室内温度计
- java 查找排序_查找与排序算法(Java实现)
- building a new horizon
- NLP 带你分析 —— 扎克伯格在听证会上说了什么?
- Ubuntu 16.04.5部署Django环境
- 总结|数学建模的收获
- PTA 7-47 打印选课学生名单分数 25 分 (C 邻接表+二叉排序树 )
- 自动驾驶——Smooth Local Planning
- C++常用函数(刷PAT甲级总结)
- 微信公众号和微信小程序进程名获取及配置
- 创客匠人用户分组:用户定向运营,不浪费一滴流量
- 量子计算机原理以及量子算法
- H.323 and Associated Protocols
- ltb火箭_火箭的大脑
- xt6使用技巧_凯迪拉克XT6中控按钮图解 XT6车内按键功能说明
热门文章
- php 循环 显示 图片,thinkphp 循环显示图片问题!!!~~~~
- 哈希表思路图解和代码实现
- 关于django新版本无法使用MySQL数据库的问题
- Css基本语法及页面引用
- 【Keras】30 秒上手 Keras+实例对mnist手写数字进行识别准确率达99%以上
- 生动形象的理解什么是装饰器!
- java 防止url重复请求_Web项目如何防止客户端重复发送请求
- MATLAB中MEX文件的编写与调试
- java中钩子函数回调函数_钩子函数 和回调函数
- 新增成功到编制为空bug_36 个JS 面试题为你助力,让面试更有力(面试必读)