I am getting the following error:
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 114 Current browser version is 116.0.5845.97 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe
Can anyone help me? I've seen some suggestions in other posts but none worked here. I am aware of the Selenium v4.6 update
My code:
from selenium import webdriver
import time
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
class ChromeAuto:
def __init__(self):
self.options = webdriver.ChromeOptions()
self.options.add_experimental_option('excludeSwitches', ['enable-logging'])
self.service = Service()
self.chrome = webdriver.Chrome(service=self.service, options=self.options)
self.chrome.implicitly_wait(20)
For Chrome 116+
you'll need selenium
4.11.2
at a minimum for the Selenium Manager to download chromedriver
116+
from https://googlechromelabs.github.io/chrome-for-testing/
Then you'll be able to run basic Selenium scripts like this:
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
service = Service()
options = webdriver.ChromeOptions()
options.add_experimental_option('excludeSwitches', ['enable-logging'])
driver = webdriver.Chrome(service=service, options=options)
# Add your code here
driver.quit()