selenium.common.exceptions.SessionN otCreatedException......解决办法

selenium 启动firefox浏览器时,报错:selenium.common.exceptions.SessionN otCreatedException: Message: Unable to find a matching set of capabilities

原因:如果出现如上信息,说明firefox浏览器版本和浏览器驱动版本不匹配。我环境:firefox49.0.2版本 geckodriver v0.19.0 ,其原因是驱动版本太高。

解决方法:1.更换较低版本geckodriver驱动,下载链接 https://github.com/mozilla/geckodriver/releases2.将驱动压缩包解压,将geckodriver.exe 放在python和火狐浏览器安装目录下 //这两个目录都已经添加至环境变量。3.重启浏览器,运行python脚本启动浏览器。

我成功运行的环境:浏览器版本:49.0.2 //可安装firebug、firexpath、最新版本不兼容。驱动:geckodriver-v0.15.0-win32 selenium: 3.13.0 (目前最新)python: 3.6.5

这个匹配Selenium 3.8.1, geckodriver.exe V.15.0 ,firefox 48.0也可以成功运行

firefox和driver对应
eckodriver 15.0的版本要求selenium 版为3.3以上,对应firefox版本要求为48.0及以上

三者参考地址如下:
1.chromedriver 下载地址:https://code.google.com/p/chromedriver/downloads/list
2.Firefox的驱动geckodriver 下载地址:https://github.com/mozilla/geckodriver/releases/
3.IE的驱动IEdriver 下载地址:http://www.nuget.org/packages/Selenium.WebDriver.IEDriver/

参考:https://www.jianshu.com/p/18e2fce4e415
https://www.cnblogs.com/tester808/p/6674588.html
https://www.cnblogs.com/wsying/p/9368035.html
https://blog.csdn.net/jpmsdn/article/details/81076080?utm_source=blogxgwz8
https://blog.csdn.net/huilan_same/article/details/51896672

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值