Search code examples
pythonselenium-webdriverautomation

Selenium webdriver is not working in Python. (chromedriver 115.0.5790.171)


I have previous selenium experiences in Python but I haven't used it for a long time. 2 days ago I formatted my computer and downloaded all my files again. I will write an automation system for a website via selenium in Python but I am facing a problem that I can't understand right now. My Chrome version is 115.0.5790.171. When I looked at the chromedriver internet update, I saw that the only stable version is 115.0.5790.170. When I try to run it with this, I get an error. Can you help me?

enter image description here

enter image description here


Solution

  • I don't understand why and how it works but it worked when I assigned the driver variable as follows.

    from selenium import webdriver
    from selenium.webdriver import Keys
    from selenium.webdriver.chrome.service import Service as ChromeService
    from selenium.webdriver.common.by import By
    from webdriver_manager.chrome import ChromeDriverManager
        driver = webdriver.Chrome(service=ChromeService(ChromeDriverManager().install()))