Skip to content

Instantly share code, notes, and snippets.

@skihero
Created December 10, 2013 05:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skihero/7886270 to your computer and use it in GitHub Desktop.
Save skihero/7886270 to your computer and use it in GitHub Desktop.
sel py
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
chromedriver= '/tmp/chromedriver'
os.environ["webdriver.chrome.driver"] = chromedriver
browser = webdriver.Chrome(chromedriver)
browser.get('http://www.site.com')
assert 'site' in browser.title
elem = browser.find_element_by_name('p') # Find the search box
elem.send_keys('seleniumhq' + Keys.RETURN)
browser.quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment