Skip to main content

Webdriver Manager for Python

Tests PyPI Supported Python Versions codecov

The main idea is to simplify management of binary drivers for different browsers.

For now support:

  • ChromeDriver

  • GeckoDriver

  • IEDriver

  • OperaDriver

  • EdgeChromiumDriver

Before: You should download binary chromedriver, unzip it somewhere in you PC and set path to this driver like this:

webdriver.Chrome('/home/user/drivers/chromedriver')

ChromeDriverManager(path=custom_path).install()

It’s boring!!! Moreover every time the new version of driver released, you should go and repeat all steps again and again.

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

Install manager:

pip install webdriver_manager

Use with Chrome:

from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager

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

Use with Chromium:

from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from webdriver_manager.utils import ChromeType

driver = webdriver.Chrome(ChromeDriverManager(chrome_type=ChromeType.CHROMIUM).install())

Use with FireFox:

from selenium import webdriver
from webdriver_manager.firefox import GeckoDriverManager

driver = webdriver.Firefox(executable_path=GeckoDriverManager().install())

Use with IE

from selenium import webdriver
from webdriver_manager.microsoft import IEDriverManager

driver = webdriver.Ie(IEDriverManager().install())

Use with Edge

from selenium import webdriver
from webdriver_manager.microsoft import EdgeChromiumDriverManager

driver = webdriver.Edge(EdgeChromiumDriverManager().install())

Use with Opera

from selenium import webdriver
from webdriver_manager.opera import OperaDriverManager

driver = webdriver.Opera(executable_path=OperaDriverManager().install())

If the Opera browser is installed in a location other than C:/Program Files or C:/Program Files (x86) on windows and /usr/bin/opera for all unix variants and mac, then use the below code,

from selenium import webdriver
from webdriver_manager.opera import OperaDriverManager

options = webdriver.ChromeOptions()
options.add_argument('allow-elevated-browser')
options.binary_location = "C:\\Users\\USERNAME\\FOLDERLOCATION\\Opera\\VERSION\\opera.exe"
driver = webdriver.Opera(executable_path=OperaDriverManager().install(), options=options)

Configuration

If you face error related to github credentials, you need to place github token: (*)

Example:

export GH_TOKEN = "asdasdasdasd"

(*) access_token required to work with Github API more info https://help.github.com/articles/creating-an-access-token-for-command-line-use/.

There is also possibility to set same variables via ENV VARIABLES.

To silent webdriver_manager logs and remove them from console, initialize env variable WDM_LOG_LEVEL with '0' value before your selenium tests:

import os

os.environ['WDM_LOG_LEVEL'] = '0'

or via constructor:

ChromeDriverManager("2.26", log_level=0).install()

By default all driver binaries are saved to user.home/.wdm folder. You can override this setting and save binaries to project.root/.wdm.

import os

os.environ['WDM_LOCAL'] = '1'

This will make your test automation more elegant and robust!

Metadata

Release files for webdriver-manager 3.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for webdriver-manager 3.1.0
File Size Uploaded Provenance Actions
webdriver_manager-3.1.0.tar.gz 10.6 kB Without provenance Details for webdriver_manager-3.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for webdriver-manager 3.1.0
File Interpreter ABI Platform Actions
webdriver_manager-3.1.0-py2.py3-none-any.whl Python 2, Python 3 none any Details for webdriver_manager-3.1.0-py2.py3-none-any.whl

Total release size: 26.6 kB

Release files / webdriver_manager-3.1.0.tar.gz

Download URL webdriver_manager-3.1.0.tar.gz
Size 10.6 kB
Tags Source
SHA-256 checksum
How to use checksums
012166903ffd612dad83687069b1e78cb12a2f876dbc8cc4e7556a42c14e344b
BLAKE2b-256 checksum
How to use checksums
fe004315cae06dba7fe6a644a3f8613d9df4ac128ccf8bdc259b4628fc765271
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

Release files / webdriver_manager-3.1.0-py2.py3-none-any.whl

Download URL webdriver_manager-3.1.0-py2.py3-none-any.whl
Size 16.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
8df74fc1fd153feccb4b563e721725c3a2457cb6dd84865d16d9b2d731a5cdfc
BLAKE2b-256 checksum
How to use checksums
1f09a3388413f06868e70dc3a24a37c6f5474f72d8a88ef0a105ea0b42943f3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

Security for webdriver-manager 3.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

3.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page