The code chunk below downloads the latest chromedriver and extracts it which is great, but if the user's chrome browser is at a lower version the code will fail.
# Get latest chromedriver zip file for mac, extract into same folder
try:
version = requests.get('https://chromedriver.storage.googleapis.com/LATEST_RELEASE').text
url = 'https://chromedriver.storage.googleapis.com/{0}/{1}'.format(version, 'chromedriver_mac64.zip')
r = requests.get(url, allow_redirects=True)
open('chromedriver.zip', 'wb').write(r.content)
with zipfile.ZipFile("chromedriver.zip", "r") as zip_ref:
zip_ref.extractall()
except:
pass
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 111 Current browser version is 110.0.5481.77 with binary path C:\xxxxx
Proposed solutions: checking if the chromedriver download is necessary before executing the try/except block.