daily pastebin goal
25%
SHARE
TWEET

Untitled

a guest Oct 16th, 2018 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top