1from selenium import webdriver
2from selenium.webdriver.common.keys import Keys
3
4driver = webdriver.Firefox()
5driver.get("http://www.python.org")
6assert "Python" in driver.title
7elem = driver.find_element_by_name("q")
8elem.clear()
9elem.send_keys("pycon")
10elem.send_keys(Keys.RETURN)
11assert "No results found." not in driver.page_source
12driver.close()
13