Skip to content

Extended Selenium Firefox webdriver to allow for user input capture and easy jQuery injection.

Notifications You must be signed in to change notification settings

nvmpy/ExtendedFirefoxDriver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

ExtendedFirefoxDriver

An extension of the Selenium webdriver.Firefox class that adds a method for capturing user input.

There's a step-by-step walkthrough of the process and some usage guidance over at my blog:

How to capture input from user in Selenium webdriver

Requirements

Requires the selenium library.

pip install selenium

For use with the Firefox geckodriver available here.

Usage

Create an instance of the ExtendedFirefoxDriver class instead of webdriver.Firefox and use the capture_input method with the following arguments.

capture_selector - (required) CSS selector of input field to capture.

trigger_selector - (optional) CSS selector of element to trigger capture on click.

Example

Capture IMDB search query

driver = ExtendedFirefoxDriver()
driver.get('http://www.imdb.com/')

search_value = driver.capture_input('#navbar-query', '#navbar-submit-button')

print "User searched: %s" % search_value
>>> 'User searched: shawshank redemption'

About

Extended Selenium Firefox webdriver to allow for user input capture and easy jQuery injection.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages