添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
在进行Selenium项目更新时遇到SessionNotCreatedException错误,经过排查发现可能是由于Selenium版本升级至4.x.x导致的,该版本可能对Chrome版本有最低要求。解决方案包括回退到Selenium3.141.0版本或升级Chrome和chromedriver到最新版,并使用services设置chromedriver路径。 摘要生成于 ,由 DeepSeek-R1 满血版支持,

今天做selenium项目更新,莫名其妙报了SessionNotCreatedException 错误,显示错误如下:

  File "D:\Program Files\Python37\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 89, in __init__
    keep_alive,
  File "D:\Program Files\Python37\lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 112, in __init__
    options=options,
  File "D:\Program Files\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 286, in __init__
    self.start_session(capabilities, browser_profile)
  File "D:\Program Files\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 378, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "D:\Program Files\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 440, in execute
    self.error_handler.check_response(response)
  File "D:\Program Files\Python37\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 245, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: Missing or invalid capabilities
  (Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Windows NT 10.0.18363 x86_64)

显示不是chromedriver与chrome版本不兼容问题。后面脑回路,终于知道原因。

之前可能安装了其它包把selenium版本更新到了4.x.x。猜测这个版本对chrome版本有最低要求。经过升级chrome版本与chromedriver,测试了下也确实能正常。懒得去追根溯源了,解决方案:

1)安装回selenium 3版本,目前最后一版3的版本号是3.141.0:

pip install selenium==3.141.0

2)升级chrome与chromedriver到较新版。记selenium4 使用services设置chromedriver路径:

from selenium.webdriver.chrome.service import Service as ChromeService
......
s = ChromeService(executable_path=driver_path)
webdriver.Chrome(service=s, options=options)
selenium.common.SessionNotCreatedException Message session not created.ChromeDriver support ver解决方案
本文主要介绍了selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 102 Current browser version is 114.0.5735.248解决方案,希望能对学习Python selenium的同学们有所帮助。 1. 问题描述 2. 解决方案
解决错:selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This versi
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version Chrome与ChromeDriver版本不一致
executable_path = Service(r"C:\Program Files\Python39\Scripts\chromedriver.exe") chrome_options = webdriver.ChromeOptions() chrome_options.add_argument('--headless') chrome_options.add_argument('--disable-gpu') browser = w. E:\Python\python.exe D:/PythonWorkSpace/PythonTest/Common/ChromeWebDriver.py Traceback (most recent call last): File "D:/PythonWorkSpace/PythonTest/Common/ChromeWebDriver.py", line 9, in <module> driver = we
selenium3.141.0+python3.6.7+firefox66.0 上述配置,下载geckodriver v0.24.0版本,驱动已配置到path中。 驱动从v0.21.0试到v0.24.0,全部以下错误。 另外,电脑里还有个firefox35,跟firefox66不在一个盘符。 使用driver=webdriver.Firefox() 一直错 实在菜鸡,折腾不出来,...
错误提示: selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 80 Chrome版本和ChromeDriver版本不一致,极有可能是Chrome浏览器自动升级了新版本,导致两者版本差异,运行不了。 解决方法: 1)查看Chrome浏览器的版本 我这里是83版本的
【chromium】解决vpython.bat generate_location_tags.py location_tags.json returned non-zero exit status 1 史蒂芬闰土: 不错,虽然我的报错不太一致,但是他这个就是开着代理访问才会出现的问题,按着改了,就解决了 交叉编译aarch64架构支持openssl的curl、libcurl 咕咕827: 请问,这个报错是什么原因呀?[code=cpp] ./configure --target=aarch64-linux-gnu --host=aarch64-linux-gnu --build=x86_64-linux-gnu --with-pic --enable-static --disable-ldap --disable-ldaps --without-libidn --with-openssl=/home/forlinx/ARM/myopenssl/output LDFLAGS=-ldl --prefix=/home/forlinx/ARM/myopenssl/curloutput configure: WARNING: unrecognized options: --without-libidn configure: error: cannot find sources (lib/urldata.h) in . or .. [/code] python 报 selenium.common.exceptions.SessionNotCreatedException T-fly: 谢谢,降级了一下selenium版本真的可以了 使用qt5.15.2 qmake 编译qtwebengine支持mp4 SmarterTech: https://download.csdn.net/download/hns707/88086775 使用qt5.15.2 qmake 编译qtwebengine支持mp4 Tan_.: 能提供编好的吗