Skip to content

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

License

Notifications You must be signed in to change notification settings

skulltech/webdriver-start

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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'

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages