Which version of chrome driver does `webdriver.Chrome()` get in Selenium with Python?
Asked Answered
C

2

-1

I know that webdriver.Chrome() below can get the chrome driver but I do not know which version of chrome driver it gets because the doc doesn't have any such explanation. *I use Selenium 4.11.2:

from selenium import webdriver

driver = webdriver.Chrome()

So, which version of chrome driver does webdriver.Chrome() get? The latest one?

Chandigarh answered 16/8, 2023 at 16:8 Comment(1)
the doc selenium.dev/documentation/webdriver/troubleshooting/errors/…Headdress
C
2

Assuming you have selenium 4.11.2 or newer installed, calling webdriver.Chrome() is going to check if any existing chromedriver on your PATH matches your version of Chrome. If not, it will automatically download the correct driver version for you to ~/.cache/selenium.

There's a blog post on it here: https://www.selenium.dev/blog/2023/whats-new-in-selenium-manager-with-selenium-4.11.0/

The Chromium Team recently restructured driver downloads for the new Chrome-for-Testing, (see https://googlechromelabs.github.io/chrome-for-testing/). The latest version of Selenium is built to handle the latest drivers for that.

Conjunct answered 16/8, 2023 at 16:20 Comment(0)
S
1

Mostly, it will be the same version as the browser on your system. For example, if chrome browser in your system is v114, then chromedriver.exe's version will be 114. Check the documentation below:

enter image description here

What's new in Selenium Manager with Selenium 4.11.0

If you are on selenium version 4.11.0 or above, go to below location in your machine, delete all the chromedriver.exe from chromedriver folder, then run your code. You will see the driver programmatically getting downloaded based on your browser in this location. Now you know which version of driver was being used to run your code.

enter image description here

Spoony answered 16/8, 2023 at 16:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.