如何解决错误【selenium.common.exceptions.SessionNotCreatedException】

 

【问题起因】

2018年12月26日晚,启动我的pycharm准备学习selenium相关的知识,结果报错了:selenium.common.exceptions.SessionNotCreatedException:   Message: Unable to find a matching set of capabilities

开始我很疑惑,因为早一段时间,火狐浏览器可以通过selenium来启动,然后又试了几次,还是报同样的错。然后只好找百度爸爸帮忙了......

【问题原因】

firefox浏览器版本和浏览器驱动版本不匹配

【解决方法】

将火狐浏览器的版本降低到 v50.0,重新下载了浏览器驱动——geckodriver V0.15

【解决问题】

更新浏览器和驱动后,能正常通过selenium打开网站。

【问题反思】

为什么selenium突然不能操作浏览器?初步分析是火狐浏览器自动升级更新了版本,导致驱动版本和浏览器版本不匹配。那如何防止火狐浏览器自动更新?

1.在浏览器的右上角有一个三道杠的图标,我们单击一下弹出小窗口,点击“选项”按钮进入新页面

2.切换到“高级”选项页,点击“更新”选项,会出现三个选项分别是自动更新,检查更新和不检查更新,就是这个三个选项来控制我们的火狐浏览器是否自动更新的。选择“不检查更新”即可防止浏览器自动更新。

如何解决错误【selenium.common.exceptions.SessionNotCreatedException】的更多相关文章

  1. 解决错误【selenium.common.exceptions.SessionNotCreatedException】

    以前能用,突然不能用了,是浏览器版本可能升级了,与原来的weddriver驱动版本不符合 解决办法:1.更新浏览器驱动, 2.降低浏览器版本

  2. 错误:selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of capabilities

    错误再现 原因:firefox浏览器版本和浏览器驱动版本不匹配 解决办法:卸载高版本浏览器,安装低版本浏览器

  3. “selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of capabilities“解决办法

    问题: 原因:firefox浏览器版本和浏览器驱动版本不匹配 解决办法:卸载高版本浏览器,安装低版本浏览器 下载地址:http://ftp.mozilla.org/pub/firefox/releas ...

  4. python 安装selenium首次运行错误selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH

    问题原因: 没有安装相关的支撑driver https://npm.taobao.org/mirrors/chromedriver/ 下载对应的driver 放置到python路径下

  5. 解决selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in P

    转载 解决selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be i ...

  6. 解决selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: invalid 'expiry'

    解决selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: invalid 'expiry'   ...

  7. selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH. 错误处理方法

    首次使用selenium webdriver,webdriver.Firefox() 报错selenium.common.exceptions.WebDriverException: Message: ...

  8. python+selenium,打开浏览器时报selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH

    有一年多没写web自动化了,今天搭建环境的时候报了一个常见错误,但是处理过程有点闹心,报错就是常见的找不到驱动<selenium.common.exceptions.WebDriverExcep ...

  9. robotframework执行用例时,报错selenium.common.exceptions.WebDriverException: Message: unknown error: cannot get automation extension from unknown error: page could not be found: chrome-extension://aapnijgdinl

    在用robotframework编写移动端测试用例(用chrome浏览器模拟手机浏览器),执行用例时, 报错selenium.common.exceptions.WebDriverException: ...

随机推荐

  1. Logback日志输出到ELK

    用docker-compose本机部署elk docker-compose.yml version: "3" services: es01: image: docker.elast ...

  2. linux 查看cpu核心数

    1.查看CPU个数 cat /proc/cpuinfo |grep "physical id"|sort|uniq|wc -l 2.查看每个物理CPU含有的核心个数 cat /pr ...

  3. 去掉或修改lightinthebox网址与标题中Wholesale关键词

    includes\languages\english.php define('SEO_COMMON_KEYWORDS','Wholesale'); 将里面的Wholesale换成你想显示的词即可.

  4. 【基础操作】博弈论 / SG 函数详解

    博弈死我了……(话说哪个小学生会玩博弈论提到的这类弱智游戏,还取石子) 先推荐两个文章链接:浅谈算法——博弈论(从零开始的博弈论) 博弈论相关知识及其应用 This article was updat ...

  5. Office365 PowerShell打开邮箱审计功能

    最近总公司要求Office365需要在所有的邮箱上面打开审计功能.这个功能没法通过图形界面操作,只能通过powershell脚本实现. 微软提供了一个官方的脚本,不过里面有个小bug https:// ...

  6. 使用TortoiseGit,设置ssh方式连接git仓库。

    开始设置之前的准备:建立项目文件夹,初始化git仓库(右键 git  init),右键打开 git bash ,git pull “仓库地址”, 把网站上的仓库代码拉取下来. TortoiseGit使 ...

  7. ORACLE纯SQL实现多行合并一行

    项目中遇到一个需求,需要将多行合并为一行.表结构如下:NAME                            Null           Type---------------------- ...

  8. java 集合数组排序

    //数组排序Integer arr[] = {3,4,2};Arrays.sort(arr);//默认升序Arrays.sort(arr,Comparator.reverseOrder());//传一 ...

  9. iptables内网访问外网 ε=ε=ε=(~ ̄▽ ̄)~

    介绍 iptables概述: netfilter/iptables : IP信息包过滤系统,它实际上由两个组件netfilter 和 iptables 组成. netfilter/iptables 关 ...

  10. nginx第五天

    nginx的全局变量 变量 说明 $args 请求中的参数,如www.123.com/1.php?a=1&b=2的$args就是a=1&b=2 $content_length HTTP ...