I'm struggling with Selenium because the official Getting Started code in the Driver Management Software section returns me an error:
OFFICIAL CODE
# Use Webdriver Manager for Python: https://github.com/SergeyPirogov/webdriver_manager
# Import code:
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.chrome.service import Service
# Use the `install()` method to set `executabe_path` in a new `Service` instance:
service = Service(executable_path=ChromeDriverManager().install())
# Pass in the `Service` instance with the `service` keyword:
driver = webdriver.Chrome(service=service)
ERROR
Current google-chrome version is 96.0.4664
Get LATEST chromedriver version for 96.0.4664 google-chrome
Driver [C:\Users\my_name\.wdm\drivers\chromedriver\win32\96.0.4664.45\chromedriver.exe] found in cache
The problem is that I've already downloaded the latest chromedriver version available, as you can see in the image below:
The chromedriver version downloaded
My Chrome Version is 96.0.4664.110 and I didn't find that version in the download drivers list, so I just downloaded the latest 96.0.4664 version (which was the 96.0.4664.45 version), as the error suggested.