Does the python library 'webdriver-manager' always install the latest chrome driver?

247 views Asked by At

Even reading the github page, the role of this library is confusing.

  1. always install the latest chrome drivers
  2. checks the user's Chrome browser version and installs the appropriate Chrome driver.

Which is it?

1

There are 1 answers

0
Talha Tayyab On BEST ANSWER

Yes, it installs the latest version.

https://pypi.org/project/webdriver-manager/

An excerpt from doc:

Before: You need to download the chromedriver binary, unzip it somewhere on your PC and set the path to this driver like this:

from selenium import webdriver
driver = webdriver.Chrome('/home/user/drivers/chromedriver')

It’s boring!!! Moreover, every time a new version of the driver is released, you need to repeat all these steps again and again.


With webdriver manager, you just need to do two simple steps:

Install manager:

pip install webdriver-manager

Use with Chrome

# selenium 3
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager

driver = webdriver.Chrome(ChromeDriverManager().install())

To install your desired version there is an option for version:

Specify the version of webdriver you need. And webdriver-manager will download it from sources for your os.

from webdriver_manager.chrome import ChromeDriverManager

ChromeDriverManager(driver_version="2.26").install()