Skip to main content

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


Download files

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

Source Distribution

webdriver-setup-1.0.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

webdriver_setup-1.0.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file webdriver-setup-1.0.0.tar.gz.

File metadata

  • Download URL: webdriver-setup-1.0.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.22.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for webdriver-setup-1.0.0.tar.gz
Algorithm Hash digest
SHA256 19db12a54a5097e13fa2a35b545f317c518644c936db953a8b0e3f37caffb4d3
MD5 5f5309b892a2e575fa03fc92051a5966
BLAKE2b-256 103f7d9d52650df2567650c99062df4735900cd719559a7cd37e6b1d8bfd6a41

See more details on using hashes here.

File details

Details for the file webdriver_setup-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: webdriver_setup-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.22.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for webdriver_setup-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 75cdb193e5dccb4fa20f2439e1b76e16ff2f65e519e184d227da413119cb0ca6
MD5 781601b81ea9f116def3e6c58986fef1
BLAKE2b-256 cd76997ff6a194f7f58ed96420156ec4094bbf7fd04b292cd145df74a2f8f893

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