pydriverr
is python module allowing management of the webdrivers for selenium.
Set environment variable DRIVERS_HOME
to point where the webdrivers should be installed
linux:
export DRIVERS_HOME=/home/$USER/webdrivers
windows:
setx DRIVERS_HOME "%USERPROFILE%\webdrivers"
Installed module provides pydriverr
command which allows performing following actions:
Following webdriver types are supported:
In order see list of available commands:
$ pydriverr --help
In order to get description and parameters list of given command:
$ pydriverr command --help
Download certain version of given WebDriver type
# Install newest chrome WebDriver for OS and arch on which pydriverr is run:
$ pydriverr install -d chrome
# Install given chrome Webdriver version for OS and arch on which pydriverr is run:
$ pydriverr install -d chrome -v 89.0.4389.23
# Install newest gecko WebDriver for given OS but the arch is taken from current OS:
$ pydriverr install -d gecko -o linux
# Install given gecko WebDriver version for given OS and arch, no matter the current OS
$ pydriverr install -d gecko -v 0.28.0 -o linux -a 64
# Install newest gecko WebDriver for current OS and 64 bit arch
$ pydriverr install -d gecko -a 64
# Install chrome driver matching version to installed Google Chrome browser (OS and arch matching current system)
$ pydriverr install -d chrome -m
Update given WebDriver or all installed WebDrivers
# Update chrome WebDriver:
$ pydriverr update -d chrome
# Update chrome and gecko WebDrivers:
$ pydriverr update -d chrome -d gecko
# Update all installed WebDrivers:
$ pydriverr update
Delete given WebDriver or all installed WebDrivers
# Remove installed chrome WebDriver:
$ pydriverr delete -d chrome
# Remove installed chrome and gecko WebDrivers:
$ pydriverr delete -d chrome -d gecko
# Remove all installed WebDrivers:
$ pydriverr delete
Delete cache directory. Cache directory grows while new drivers are downloaded.
# Delete cache directory, it will be recreated on next pydriverr run
$ pydriverr clear-cache
List of WebDrivers available to install - of given type
# Show list of WebDrivers available to install for given driver type.
# List contains versions and supported OS and architectures
$ pydriverr show-available -d chrome
List installed WebDrivers in a form of table
# Show all installed WebDrivers
$ pydriverr show-installed
Show where WebDrivers are downloaded to and cache dir with usage data
$ pydriverr show-env
Clone the repository
$ git clone git@github.com:czerus/pydriverr.git
Install Poetry
If you want to create virtual env inside the same folder:
$ poetry config virtualenvs.in-project true
Install project and all dependencies using poetry.
$ poetry install
Add code
Check linting and formatting by running
# To check
$ python lint.py
# To fix
$ python lint.py --fix
Run all tests with coverage:
$ python3 -m pytest tests --cov=pydriverr --cov-report html --cov-report term -vv
Commit and push