webdriver-setup
Easy to use webdriver instance creation api.
This package prevents manually downloading and setup of the webdriver binaries by automatically finding and installing the related webdriver binary, and provides an easy to use instance creation api. It uses webdriver_manager package.
Supported browsers
- Firefox
- Chrome
- Opera
- Safari
- Ie
- Edge (Chromium based)
Installation
pip install webdriver-setup
Usage
from webdriver_setup import get_webdriver_for
# create driver instance
driver = get_webdriver_for("firefox")
# start the browser with the given url
driver.get("https://www.python.org/")
# print the title of the website
print(f"Title: {driver.title}")
# quit browser
driver.quit()
You can also pass all the keyworded arguments as you would normally do with the Selenium webdriver instances.
from webdriver_setup import get_webdriver_for
from selenium.webdriver import FirefoxOptions
firefox_options = FirefoxOptions()
firefox_options.add_argument("--headless")
driver = get_webdriver_for("firefox", options=firefox_options)
WDM Config
If you don't want to see webdriver_manager logs, set environment variable "WDM_LOG_LEVEL" to "0"
import os
os.environ["WDM_LOG_LEVEL"] = "0"
If you don't pass the cache_valid_range option, it will be set to 7 days by default.
You can change it as follows
from webdriver_setup import get_webdriver_for
driver = get_webdriver_for("firefox", cache_valid_range=3)
Release files for webdriver-setup 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| webdriver-setup-1.1.0.tar.gz | 4.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| webdriver_setup-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.6 kB
Release files / webdriver-setup-1.1.0.tar.gz
| Download URL | webdriver-setup-1.1.0.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
be3f1a8399f8ed457bc743a3c1fb1e1446a9be717f4ee8122f19c2725f3babac
|
|
BLAKE2b-256 checksum How to use checksums |
7536b8c4b42e35a28ecc77cb2de9e9017c8eecb82c0b051583f77c589c493ca5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
|
Release files / webdriver_setup-1.1.0-py3-none-any.whl
| Download URL | webdriver_setup-1.1.0-py3-none-any.whl |
|---|---|
| Size | 9.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c18fb4385514b6a3bc17d3392e13d405296077bf676cc3812821af3be3683657
|
|
BLAKE2b-256 checksum How to use checksums |
dbd831c28e903775730d4935a92cd93c7e769a6f76b5ce246dccb1454a2e4245
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
|