Skip to main content

Python module and CLI tool for facilitating download and deploy of WebDriver binaries.

Project description

Python module to facilitate downloading and deploying WebDriver binaries. The classes in this module can be used to automatically search for and download the latest version (or a specific version) of a WebDriver binary (will download to $HOME/webdriver or /usr/local/webdriver if run with sudo), extract the binary from the downloaded archive and create a symlink in either /usr/local/bin (if run with sudo) or $HOME/bin.

Note: For non-root users, the $HOME/bin directory may not be in the search PATH. If you are unable to add this directory your search path, a workaround is to capture the return value from the download() or download_and_install() method (see the docstrings for those methods for more information on the return values) and pass the path to the downloaded webdriver binary as a parameter to the constructor for the Selenium WebDriver instance. See the documentation for the executable_path parameter for the relevant WebDriver class for more information.

Installation

This module is available on the Python Package Index (PyPI) and can be installed as follows:

pip install webdriverdownloader

Dependencies

This module is dependent on the following additional packages:

Classes

The following classes are available:

  • ChromeDriverDownloader for downloading and installing chromedriver (for Google Chrome).

  • GeckoDriverDownloader for downloading and installing geckodriver (for Mozilla Firefox).

Status

![Python package cross version testing](https://github.com/bodharma/webdriverdownloader/workflows/Python%20package%20cross%20version%20testing/badge.svg)

Example module usage

Example:

>>> from webdriverdownloader import GeckoDriverDownloader
>>> gdd = GeckoDriverDownloader()
>>> gdd.download_and_install()
1524kb [00:00, 1631.24kb/s]
('/Users/lsaguisag/webdriver/geckodriver-v0.20.1-macos/geckodriver', '/Users/lsaguisag/bin/geckodriver')
>>> gdd.download_and_install("v0.20.0")
1501kb [00:02, 678.92kb/s]
Symlink /Users/lsaguisag/bin/geckodriver already exists and will be overwritten.
('/Users/lsaguisag/webdriver/geckodriver-v0.20.0-macos/geckodriver', '/Users/lsaguisag/bin/geckodriver')
>>> gdd.download_and_install()
Symlink /Users/lsaguisag/bin/geckodriver already exists and will be overwritten.
('/Users/lsaguisag/webdriver/geckodriver-v0.20.1-macos/geckodriver', '/Users/lsaguisag/bin/geckodriver')
>>>

Command line tool

There is a command-line tool that is also available. After installing the package, it can be used as follows (Windows example):

> webdriverdownloader chrome:2.38 firefox
Downloading WebDriver for browser: 'chrome'
3300kb [00:00, 11216.38kb/s]
Driver binary downloaded to: C:\Users\lsaguisag\webdriver\chrome\2.38\chromedriver_win32\chromedriver.exe
Driver copied to: C:\Users\lsaguisag\bin\chromedriver.exe

Downloading WebDriver for browser: 'firefox'
3031kb [00:01, 2253.64kb/s]
Driver binary downloaded to: C:\Users\lsaguisag\webdriver\gecko\v0.20.1\geckodriver-v0.20.1-win64\geckodriver.exe
Driver copied to: C:\Users\lsaguisag\bin\geckodriver.exe

License

This is released under an MIT license. See the LICENSE file in this repository for more information.

Important: Consult the license terms of the providers of the WebDriver downloads prior to downloading / using the WebDrivers.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

webdriverdownloader2-2.0.3.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

webdriverdownloader2-2.0.3-py2.py3-none-any.whl (9.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file webdriverdownloader2-2.0.3.tar.gz.

File metadata

  • Download URL: webdriverdownloader2-2.0.3.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.1

File hashes

Hashes for webdriverdownloader2-2.0.3.tar.gz
Algorithm Hash digest
SHA256 11d722670245cf04de95a131ebccf69bd138b4d6466b99fcbe3395f2feaf736a
MD5 f4f88d5b713c276534b9377d5d9f6878
BLAKE2b-256 491ea6dcc67d83cb4a38296abdef7af606e1d4bdda2d825d3ff0fc63d3fb2a51

See more details on using hashes here.

File details

Details for the file webdriverdownloader2-2.0.3-py2.py3-none-any.whl.

File metadata

  • Download URL: webdriverdownloader2-2.0.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.1

File hashes

Hashes for webdriverdownloader2-2.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 cd34e4d0c8dbbc7dbb2f0137569b8ead5475695aca2ec6c35ed53c4da7b4ede9
MD5 6f8ca9df90be3605871e1cdbaaa52f07
BLAKE2b-256 2f09deae0de12ad49fd0c320b484d806cc55b981cbc4554161cd5ae7da5a25d5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page