Easy to use webdriver instance creation api
Project description
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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file webdriver-setup-1.1.0.tar.gz.
File metadata
- Download URL: webdriver-setup-1.1.0.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be3f1a8399f8ed457bc743a3c1fb1e1446a9be717f4ee8122f19c2725f3babac
|
|
| MD5 |
86b134cbfd47dbe981595e4dc0ddd2e2
|
|
| BLAKE2b-256 |
7536b8c4b42e35a28ecc77cb2de9e9017c8eecb82c0b051583f77c589c493ca5
|
File details
Details for the file webdriver_setup-1.1.0-py3-none-any.whl.
File metadata
- Download URL: webdriver_setup-1.1.0-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c18fb4385514b6a3bc17d3392e13d405296077bf676cc3812821af3be3683657
|
|
| MD5 |
8e97b3534783313d8771f5253be5e5bc
|
|
| BLAKE2b-256 |
dbd831c28e903775730d4935a92cd93c7e769a6f76b5ce246dccb1454a2e4245
|