Skip to main content

Reliable module for starting up Selenium Webdriver, with custom user-agent and custom profile

Project description

webdriver-start

Reliable module for starting up Selenium Webdriver with custom modifications. Supports —

  • Custom user-agent
  • Custom user profile.
  • Headless mode.
  • Firefox and Chrome webdrivers. Open an issue if you want support for more.

Installation

Install it using pip —

$ pip install webdriver-start

Usage

For Chrome

>>> from wdstart import webdriver
>>> driver = webdriver.Chrome(headless=True, user_agent='this is a custom user-agent', user_profile='/path/to/profile/')
>>> driver
<selenium.webdriver.chrome.webdriver.WebDriver (session="46157cffe549da015b288cdabea94a29")>
>>> driver.get('http://www.google.com')
>>> driver.title
'Google'
>>> driver.execute_script('return navigator.userAgent')
'this is a custom user-agent'

Similarly, for Firefox

>>> from wdstart import webdriver
>>> driver = webdriver.Firefox(headless=True, user_agent='this is a custom user-agent', user_profile='/path/to/profile/')
>>> driver
<selenium.webdriver.chrome.webdriver.WebDriver (session="46157cffe549da015b288cdabea94a29")>
>>> driver.get('http://www.google.com')
>>> driver.title
'Google'
>>> driver.execute_script('return navigator.userAgent')
'this is a custom user-agent'

Project details


Download files

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

Files for webdriver-start, version 1.1.0
Filename, size File type Python version Upload date Hashes
Filename, size webdriver_start-1.1.0-py3-none-any.whl (2.6 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size webdriver-start-1.1.0.tar.gz (3.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page