Skip to content

Instantly share code, notes, and snippets.

@talktokets
Created June 22, 2016 10:19
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 talktokets/d02b50ebec3b56cfae011e52a3fab576 to your computer and use it in GitHub Desktop.
Save talktokets/d02b50ebec3b56cfae011e52a3fab576 to your computer and use it in GitHub Desktop.
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Firefox()
driver.get("http://www.python.org")
assert "Python" in driver.title
elem = driver.find_element_by_name("q")
elem.clear()
elem.send_keys("pycon")
elem.send_keys(Keys.RETURN)
assert "No results found." not in driver.page_source
driver.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment