0
0
Selenium-pythonDebug / FixBeginner · 4 min read

Fix Chromedriver Version Mismatch in Selenium Quickly

A chromedriver version mismatch error happens when your Chrome browser version and the Chromedriver version do not match. To fix it, download the Chromedriver version that matches your Chrome browser or update your Chrome to match the Chromedriver. Always keep both updated to avoid this error.
🔍

Why This Happens

This error occurs because Selenium uses Chromedriver to control the Chrome browser. Chromedriver must be compatible with the installed Chrome browser version. If they differ, Selenium cannot start the browser properly.

python
from selenium import webdriver

# This code will fail if chromedriver version does not match Chrome browser
browser = webdriver.Chrome()
browser.get('https://www.google.com')
Output
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version XX Current browser version is YY
🔧

The Fix

Check your Chrome browser version by navigating to chrome://version/. Then download the matching Chromedriver from the official site. Replace your old Chromedriver with the new one. This ensures Selenium can control the browser without errors.

python
from selenium import webdriver

# Correct chromedriver path after updating to match Chrome version
driver_path = '/path/to/updated/chromedriver'
browser = webdriver.Chrome(executable_path=driver_path)
browser.get('https://www.google.com')
print('Browser opened successfully')
Output
Browser opened successfully
🛡️

Prevention

To avoid this error in the future:

  • Regularly update both Chrome browser and Chromedriver.
  • Use tools like webdriver-manager to automate driver management.
  • Match Chromedriver version exactly with your Chrome browser version.
  • Check compatibility notes on the Chromedriver download page.
⚠️

Related Errors

Other common Selenium errors include:

  • SessionNotCreatedException: Happens if driver and browser versions mismatch.
  • TimeoutException: When browser takes too long to respond.
  • NoSuchElementException: When Selenium cannot find a web element.

Fixes usually involve updating drivers, increasing timeouts, or correcting locators.

Key Takeaways

Always match Chromedriver version with your Chrome browser version to avoid errors.
Update both Chrome and Chromedriver regularly to keep compatibility.
Use tools like webdriver-manager to automate driver updates.
Check error messages carefully to identify version mismatches.
Replacing Chromedriver with the correct version fixes the mismatch error immediately.