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

Improve regex for chrome version #33

Open brummetj opened 4 years ago

brummetj commented 4 years ago

Hey there!

There was a small issue with downloading specific chromedrivers as the versions have gotten extra long and extravagant. For example to download chromedriver version 80, you would have to type out webdrivermanager chrome:83.0.4103.14 ... man that is brutal!

I went ahead and improved the regex for the name key from the API request to account for just getting a specific version by doing something like chrome:83 or chrome:80 to keep things simple, and of course you can go deeper in the version number, as i just just add .0 to the version number to make sure it doesn't pick up a random minor version when doing the regex. ( most major version number releases will have something like 81.0 or 83.0 )... so this should suffice.

With this you can just write webdriveragent chrome:83 now and it will download chromdriver version 83.

cheers

rasjani commented 4 years ago

Hiya and thanks for the PR. Idea looks useful - Ill have a look of the changes over the weekend.

brummetj commented 4 years ago

Perfect thanks!

I just fixed up the logic a little for handling the "latest" and I made it so it will always grab the last entry in the entry list, which is helpful for using the new logic I'm introducing for grabbing version by something like chrome:83, so it will always get the latest version of 83.

xylix commented 3 years ago

@rasjani we make quite a lot of use of webdrivermanager.py at robocorp/rpaframework. Would be interested in getting this merged. What are the current parts blocking this PR from being merged?