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
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
webdriver-start-1.1.0.tar.gz
(3.0 kB
view details)
Built Distribution
File details
Details for the file webdriver-start-1.1.0.tar.gz
.
File metadata
- Download URL: webdriver-start-1.1.0.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81d2a3b030dc029434dc8c7e2fdd6d087d28142995dcc3eea561cb41bf4a88c2 |
|
MD5 | 10a5d104d947c17ddf005b374547338b |
|
BLAKE2b-256 | 3f58ea825cd44d983ea928a21a638e20f0960e37bac774cb1862ac5a2369d124 |
File details
Details for the file webdriver_start-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: webdriver_start-1.1.0-py3-none-any.whl
- Upload date:
- Size: 2.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9f9163e8f770aea514c91c29e9fb3a0e9913a4747237f8f7300206446526883 |
|
MD5 | 19e7b23015d7e49795359171c251f6d8 |
|
BLAKE2b-256 | 808ba3b4a9bb143aeda980037eee7264523e7fbb2cce384d44bf738a58f81aa7 |