from selenium import webdriver from selenium.webdriver.common.keys import Keys URL = "http://jpython.blogspot.com" driver = webdriver.Firefox() driver.get(URL) print driver.title search = driver.find_element_by_name("q") # find search field search.send_keys("BFS") # set search key search.send_keys(Keys.RETURN) # hit enter driver.implicitly_wait(10) # wait 10 seconds driver.close()
Output:
Life is very easy with Python
0 comments:
Post a Comment