Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/359.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python SessionNotCreatedException:消息:会话未创建:此版本的ChromeDriver仅支持使用Selenium ChromeDriver v81的Chrome版本81_Python_Selenium_Google Chrome_Webdriver_Selenium Chromedriver - Fatal编程技术网

Python SessionNotCreatedException:消息:会话未创建:此版本的ChromeDriver仅支持使用Selenium ChromeDriver v81的Chrome版本81

Python SessionNotCreatedException:消息:会话未创建:此版本的ChromeDriver仅支持使用Selenium ChromeDriver v81的Chrome版本81,python,selenium,google-chrome,webdriver,selenium-chromedriver,Python,Selenium,Google Chrome,Webdriver,Selenium Chromedriver,我从selenium和os导入了webdriver。我希望能够成功运行这段代码: driver = webdriver.Chrome(executable_path= os.path.abspath('') + '/chromedriver') 我得到的错误是: selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver onl

我从selenium和os导入了webdriver。我希望能够成功运行这段代码:

driver = webdriver.Chrome(executable_path= os.path.abspath('') + '/chromedriver')
我得到的错误是:

selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 81
我正在MacOSX上使用Python2.7。 我已经从安装了chromedriver的81.0.4044.138版本
在同一个工作区目录中,它被命名为“chromedriver”,但好像我的webdriver不认识它。如果有任何建议,我将不胜感激

在大多数情况下,这是由于Chrome web驱动程序版本和Chrome浏览器版本之间的差异造成的

我建议您执行以下操作: 1-备份你的工作。 2-将Chrome浏览器更新至最新版本。 3-安装最新版本的chrome浏览器。 4-杀死任何在后台运行的chromedriver进程。 5-清理代码并尝试一下。

此错误消息

selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 81
…表示ChromeDriver无法启动/生成新的浏览上下文,即Chrome浏览器会话


分析 您的主要问题是所使用的二进制文件版本之间的不兼容,如下所示:

  • 您正在使用ChromeDriver 81.0
  • 的发行说明明确提到以下内容:
支持Chrome 81版

最有可能的是,Chrome浏览器在最近的推送中更新为

  • 的发行说明明确提到以下内容:
支持Chrome 83版

  • 我们不知道您的Selenium客户端版本
因此,ChromeDriver v81.0和Chrome浏览器v83.0之间存在明显的不匹配


解决方案 确保:

  • 硒被提升到当前水平
  • ChromeDriver已更新到当前级别
  • Chrome更新到当前的Chrome版本83.0级别。(根据)
  • 如果您的基本Web客户端版本太旧,请卸载它并安装最新的GA和Web客户端发布版本
  • 以非root用户身份执行
    @Test