selenium.common.exceptions.SessionNotCreatedException: Message: session not created: Chrome version must be between 70 and 73 with ChromeDriver

前端 未结 11 1457
轮回少年
轮回少年 2021-02-05 08:03

I am trying to create a webcrawler using Selenium, but I get this error when I try to create the webdriver object.

selenium.common.exceptions.SessionNotCreatedEx         


        
11条回答
  •  死守一世寂寞
    2021-02-05 08:57

    This error message...

    selenium.common.exceptions.SessionNotCreatedException: Message: session not created: Chrome version must be between 70 and 73
    (Driver info: chromedriver=2.45.615291 (ec3682e3c9061c10f26ea9e5cdcf3c53f3f74387),platform=Windows NT 6.1.7601 SP1 x86_64)
    

    ...implies that Chrome version must be between 70 and 73


    Your main issue is the version compatibility between the binaries you are using as follows :

    • You are using chromedriver=2.45
    • Release Notes of chromedriver=2.45 clearly mentions the following :

    Supports Chrome v70-72

    • You are using chrome=68.0
    • Release Notes of ChromeDriver v2.41 clearly mentions the following :

    Supports Chrome v67-69

    So there is a clear mismatch between ChromeDriver v2.45 and the Chrome Browser v68.0


    Solution

    • Upgrade ChromeDriver to current ChromeDriver v2.45 level.
    • Keep Chrome version between Chrome v70-72 levels. (as per ChromeDriver v2.45 release notes)
    • Take a System Reboot.
    • Execute your @Test.

    Alternative

    Somehow I feel there are 2 versions of Chrome browser installed in your system. If that is the case you need to mention the absolute location of the Chrome binary within your program and you can use the following solution:

    • Code Block:

      from selenium import webdriver
      from selenium.webdriver.chrome.options import Options
      options = Options()
      options.binary_location = "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe"
      driver = webdriver.Chrome(chrome_options=options, executable_path="C:/Utility/BrowserDrivers/chromedriver.exe", )
      driver.get('http://google.com/')
      
    • You can find a detailed discussion in Set chrome browser binary through chromedriver in Python

    Note: You can find a relevant discussion in Session not created exception: Chrome version must be >= x.y.z when using Selenium Webdriver with Chrome


    Reference

    You can find a relevant detailed discussion in:

    • How to work with a specific version of ChromeDriver while Chrome Browser gets updated automatically through Python selenium

提交回复
热议问题