SergeyPirogov / webdriver_manager

Apache License 2.0
2.07k stars 461 forks source link

Each latest chrome version(currently 118.0.5993.88) not supported by the webdriver_manager latest version #639

Open naivomah3 opened 1 year ago

naivomah3 commented 1 year ago

I keep having an error message each time chrome is getting updated although I got the latest webdriver_manager installed correctly.

I'm looking for any workaround to get the correct ChromeDriver version downloaded and supports the current chrome version. Regards,

selenium.common.exceptions.SessionNotCreatedException: 
Message: Could not start a new session. Error while creating session with the driver service. 
Stopping driver service: Could not start a new session. 
Response code 500. 
Message: session not created: This version of ChromeDriver only supports Chrome version 116
Current browser version is 118.0.5993.88 with binary path /usr/bin/google-chrome 
jovepy commented 1 year ago

Enfrentando o mesmo problema.

raise exceptions.ConnectionError(f"Could not reach host. Are you offline?")

File "D:\AMBIENTES\p397\lib\site-packages\webdriver_manager\chrome.py", line 40, in install driver_path = self._get_driver_binary_path(self.driver) File "D:\AMBIENTES\p397\lib\site-packages\webdriver_manager\core\manager.py", line 35, in _get_driver_binary_path binary_path = self._cache_manager.find_driver(driver) File "D:\AMBIENTES\p397\lib\site-packages\webdriver_manager\core\driver_cache.py", line 105, in find_driver driver_version = self.get_cache_key_driver_version(driver)

rtorres90 commented 1 year ago

same issue here, I'm using the webdriver-manager 4.0.1

rtorres90 commented 1 year ago

today it started to work again for me

cosad3s commented 10 months ago

Same error here - With Chromium 120:

    driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/selenium/webdriver/chrome/webdriver.py", line 45, in __init__
    super().__init__(
  File "/usr/lib/python3/dist-packages/selenium/webdriver/chromium/webdriver.py", line 61, in __init__
    super().__init__(command_executor=executor, options=options)
  File "/usr/lib/python3/dist-packages/selenium/webdriver/remote/webdriver.py", line 209, in __init__
    self.start_session(capabilities)
  File "/usr/lib/python3/dist-packages/selenium/webdriver/remote/webdriver.py", line 293, in start_session
    response = self.execute(Command.NEW_SESSION, caps)["value"]
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/selenium/webdriver/remote/webdriver.py", line 348, in execute
    self.error_handler.check_response(response)
  File "/usr/lib/python3/dist-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 114
Current browser version is 120.0.6099.216 with binary path /usr/bin/chromium
Stacktrace:
#0 0x557f6b33a4e3 <unknown>
#1 0x557f6b069c76 <unknown>
#2 0x557f6b09704a <unknown>
#3 0x557f6b0924a1 <unknown>
#4 0x557f6b08f029 <unknown>
#5 0x557f6b0cdccc <unknown>
#6 0x557f6b0cd47f <unknown>
#7 0x557f6b0c4de3 <unknown>
#8 0x557f6b09a2dd <unknown>
#9 0x557f6b09b34e <unknown>
#10 0x557f6b2fa3e4 <unknown>
#11 0x557f6b2fe3d7 <unknown>
#12 0x557f6b308b20 <unknown>
#13 0x557f6b2ff023 <unknown>
#14 0x557f6b2cd1aa <unknown>
#15 0x557f6b3236b8 <unknown>
#16 0x557f6b323847 <unknown>
#17 0x557f6b333243 <unknown>
#18 0x7f26aaa013ec <unknown>
raylabres commented 10 months ago

I created a function in Python to define the browser to be used. With Chrome and Microsoft Edge, when Chrome doesn't work due to updates, I use Microsoft Edge.

def define_navegador(site, mostrar_navegador):
    if mostrar_navegador == False:   
        try:
            options = OptionChrome()
            options.add_argument('--headless')
            servico = Service(ChromeDriverManager().install())
            navegador = webdriver.Chrome(service=servico, options=options)

        except:
            options = OptionEdge()
            options.add_argument('--headless')
            servico = Service(EdgeChromiumDriverManager().install())
            navegador = webdriver.Edge(service=servico, options=options)

    else:
        try:
            servico = Service(ChromeDriverManager().install())
            navegador = webdriver.Chrome(service=servico)

        except:
            servico = Service(EdgeChromiumDriverManager().install())
            navegador = webdriver.Edge(service=servico)

    navegador.get(site)
    navegador.maximize_window()
    sleep(2)
    return navegador