Advertisement
Guest User

Untitled

a guest
Oct 16th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. # prior to running this run `pip install -U selenium`
  2. from selenium import webdriver
  3.  
  4. # create a new Chrome session
  5. driver = webdriver.Chrome()
  6. driver.implicitly_wait(10)
  7.  
  8. # Navigate to the application home page
  9. driver.get("https://www.google.com")
  10.  
  11. # get the search textbox
  12. search_field = driver.find_element_by_name("q")
  13. search_field.clear()
  14.  
  15. # enter search keyword and submit
  16. search_field.send_keys("cats")
  17. search_field.submit()
  18.  
  19. # close the browser window
  20. driver.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement