python3 selenium ie 拒绝连接报错_Python3+selenium配置常见报错解决方案
第一个坑:'geckodriver' executable needs to be in PATH
1.如果启动浏览器过程中报如下错误
Traceback (most recent call last):
File "", line 1, in
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 start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.
2.这个是因为最新的selenium3.0启动firefox需要geckodriver.exe这个驱动文件。
3.下载之后,配置到环境变量path下(可以直接放python根目录)
第二坑:Expected browser binary location, but unable to find binary in default location
1.如果启动浏览器过程中报如下错误:
Traceback (most recent call last):
File "", line 1, in
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_session
response = self.execute(Command.NEW_SESSION, capabilities)
File "D:\test\python3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 238, in execute
self.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: 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.
2.这个是因为firefox.exe这个文件也需要配置到环境变量path下。
3.这个路径就是安装完firefox后,找到firefox.exe这个文件的地址,加到path下。
第三坑:Unsupported Marionette protocol version 2, required 3
1.如果启动浏览器过程中出现如下错误
Traceback (most recent call last):
File "", line 1, in
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_session
response = self.execute(Command.NEW_SESSION, capabilities)
File "D:\test\python3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 238, in execute
self.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
2.这个错误原因是firefox版本过低了,最新的selenium3.0版本支持firefox47以上的版本,升级版本就可以了
第四坑:WebDriverException: Message: newSession
1.Traceback (most recent call last):
File “D:\test\python3\lib\site-packages\selenium\webdriver\firefox\\webdriver.py”, line 170, in init
keep_alive=True)
File “D:\test\python3\lib\site-packages\selenium\webdriver\firefox\\webdriver.py”, line 156, in init
self.start_session(capabilities, browser_profile)
File “D:\test\python3\lib\site-packages\selenium\webdriver\firefox\\webdriver.py”, line 245, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File “D:\test\python3\lib\site-packages\selenium\webdriver\firefox\\webdriver.py”, line 314, in execute
self.error_handler.check_response(response)
File “D:\test\python3\lib\site-packages\selenium\webdriver\firefox\\errorhandler.py”, line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: newSession
2.下载最新的geckodriver.exe 然后把它放到python的安装目录下
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持服务器之家。
原文链接:https://www.cnblogs.com/pian-03/p/13513650.html
python3 selenium ie 拒绝连接报错_Python3+selenium配置常见报错解决方案相关推荐
- selenium firefox驱动_Python3+selenium配置常见报错解决方案
第一个报错问题 'geckodriver' executable needs to be in PATH 1.1如果启动浏览器过程中报如下错误: Traceback (most recent call ...
- python index 报错_python基础语法常见报错类型
一.TypeError:类型错误,对象⽤来表示值的类型⾮预期类型时发⽣的错误. ### 错误例⼦: age=18 print('我的年龄是'+age) ### 报错信息:TypeError:canon ...
- hadoop报错 java home_hadoop的常见报错日志以及解决方案
1. WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using built ...
- python报错_python 常见报错
python 常见报错 IndentationError: 缩进错误 IndentationError: expected an indented block 应为缩进快 必须统一使用tab 不能空格 ...
- apex常见报错,亲测1080Ti/2080Ti/3090显卡均适用
apex常见报错,亲测可用 环境:torch1.7.1 python3.8 ,1080Ti/2080Ti/3090显卡均适用.结尾有一键解决方案. 主要针对问题: AttributeError: mo ...
- python计算机视觉常见报错及解决方案(不断更新中)
python计算机视觉常见报错及解决方案 1.did not meet fit acceptance criteria 2.all the input arrays must have same nu ...
- onkeypress属性添加报错_亚马逊运营过程中listing常见报错及应对策略汇总
亚马逊运营过程中listing常见报错及应对策略汇总 做亚马逊的小哥哥小姐姐们还在为上传产品中的报错提示而抓狂吗?福利来了,总结了17个常见报错,供大家查阅 1.SKU XXXXX, Missing ...
- kubeadm常见报错和解决方法
kubeadm常见报错和解决方法 参考文章: (1)kubeadm常见报错和解决方法 (2)https://www.cnblogs.com/only-me/p/10219903.html 备忘一下.
- 微信小程序根据坐标点解析地址常见报错:请求来源未被授权
功能需求 微信小程序提供的接口能够获取到当前位置的坐标(经纬度),但是不能得到当前位置的地址.或者从后台获取到坐标(经纬度)要解析成文字描述的地址小程序也没有对应的接口. 实现思路 这时候就需要通过腾 ...
最新文章
- SPRING事务传播特性
- LINQ 查询表达式(C# 编程指南)
- QT的QMediaPlaylist类的使用
- Maven 搭建spring boot多模块项目(附源码)
- 微信小程序开发错误:LoginError {type: ERR_WX_GET_USER_INFO}解决方法
- 使用Redis创建分布式锁
- SpringBoot POM 继承(spring-boot-starter-parent)
- 11.8 scrum report
- 史上最强的MSN聊天记录!
- 昆明理工大学计算机考研资料汇总
- unity的立方贴图
- SpringBoot学习历程(十一):SpringBoot2.X集成mail发送邮件
- 《“ 追梦人” 的逐梦路:探寻大学生创客群体的发展之道》
- VUE3(二十四)自定义alert弹窗组件
- locust快速入门
- 【原创】flutter之发布插件包到pub.dev离线在线两套大法
- / 和 /* 和 /** 的区别
- 网易云易盾朱浩齐:视听行业步入强监管和智能时代
- 坦克大战项目c语言代码,c语言 坦克大战 游戏源码下载
- Glyph 26426 missing from current font.解决matplotlib画图中文字体乱码问题
热门文章
- FileZilla 服务器端win server2008以上的配置
- 剑指offer_第一个只出现一次的字符
- Centos6.x服务器配置jdk+tomcat+mysql环境
- nginx介绍(一) 简介篇
- Begin to use Tex Example (from others)
- Spring Security使用数据库管理资源整理
- 最近总结——关于自己的基础问题
- 技术管理中的“沟通”
- Hibernate 主清单文件配制说明
- Block循环引用问题(Objective-c)