Python Forum

Full Version: ChromeDriver breaking Python script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Have an old script im trying to run. It uses "chromedriver.exe" to run. Every once in a while when chrome updates it breaks the app and id have to go to the chromedriver website, download the latest chromedriver.exe and replace the old one in my python script folder and it works.

When I run my python script it gives the error: "chromedriver version 114 not compatible with chrome ver 122 - chromedriver 122.06.6261.128 is recommended for chrome 122". However, on the chromedriver site it looks like after ChromeDriver 114 they no longer have .exe but zip files with a bunch of files inside.

Any ideas how i Can get chromedriver.exe version 122 to get my script running again?

Thank you.
The link to driver is now in a Json file JSON API endpoints last-known-good-versions-with-downloads.json.
Example.
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
import time

# Setup
# https://storage.googleapis.com/chrome-for-testing-public/122.0.6261.128/win64/chromedriver-win64.zip
options = Options()
options.add_argument("--headless=new")
ser = Service(r"C:\cmder\bin\chromedriver.exe")
browser = webdriver.Chrome(service=ser, options=options)
# Parse or automation
url = 'https://www.python.org/'
browser.get(url)
python_about = browser.find_element(By.CSS_SELECTOR, '#touchnav-wrapper > header > div > div.introduction > p')
print(python_about.text)
Output:
Python is a programming language that lets you work quickly and integrate systems more effectively. Learn More