MarketSquare / webdrivermanager

Python module to facilitate downloading and deploying WebDriver binaries for Chrome, Firefox, Opera & Edge
https://pypi.org/project/webdrivermanager/
MIT License
100 stars 38 forks source link

Add possibility to probe browser version and match that into webdriver version that should be downloaded #23

Closed rasjani closed 7 months ago

NMamm commented 5 years ago

For each operating system we need to define a way to detect the installed version of a given browser. On Windows, for example, this involves reading the registry to identify the location of the executable. I would not know how to do this on linux/mac. Once we have the executable's path, we can use pefile to read the version number on any os.

For each browser, we need to define a method for querying the matching driver version for a given browser version. download_and_install(version) will take over from there.

xylix commented 3 years ago

I propose using subprocess and --version argument for detecting browser versions. It is a bit ugly but it will work on all operating systems. https://github.com/rasjani/webdrivermanager/pull/43 contains an implementation for Chrome.