Skip to content

A lightweight wrapper over selenium python webdriver

License

Notifications You must be signed in to change notification settings

dfeeley/selenium-wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Selenium Wrapper

Convenience wrapper for Selenium webdriver.

Wraps the basic functionality of get, find, and wait for logging and exception handling.

Also includes a factory for constructing either local or remote webdrivers.

In local mode console will be viewable at http://localhost:4444/wd/hub/static/resource/hub.html

from selenium_wrapper import factory

driver = factory.local(debug=True, handle_method='break', log_root='/tmp/selenium', headless=True)

driver.get('http://www.example.com', wait=0)

driver.find('#username').send_keys('myuser')
driver.find('#password').send_keys('mypassword')
driver.find('#login').click()

driver.wait('.some .selector')

driver.get('https://www.example.com/next', wait=4)

elem = driver.find('table tbody tr td:nth-child(2)')
print(elem.text)

driver.quit()

About

A lightweight wrapper over selenium python webdriver

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages