Solving webdriver issues in selenium (Windows OS)
Quick and dirty method to solve webdriver.Chrome() and webdriver.Edge() version mismatch issues.
Last night I was trying to run selenium webdriver for a scraping project. When I tried to run chrome webdriver, I got an error message saying there is a version mismatch:
from selenium import webdriver
webdriver.Chrome()SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 88
Current browser version is 100.0.4896.127 with binary path ...I tried to update chromedriver using pip install chromedriver_py --upgrade, while the status message said my chromedriver was updated to the latest version, I still ended up getting the same SessionNotCreatedException message.
I also tried the download-and-replace method — (i) download latest chromedriver from here, and (ii) replace the chromdriver.exe at “C:\Users\Me\Anaconda3\Lib\site-packages\chromedriver_py” with the downloaded chromdriver.exe file. While this should have worked (ideally), it did not! :(
Finally, I got chromedriver working by directly pointing to the downloaded updated chromedriver. Command that worked:
webdriver.Chrome(r'C:\Users\Me\Downloads\chromedriver_win32(1)\chromedriver')
This method worked with Edge also.
webdriver.Edge(r'C:\Users\Me\Downloads\edgedriver_win64\msedgedriver')
I could not get this method work with Firefox and Opera though! Maybe next time.
