Advertisement
steve-shambles-2109

search amazon

Feb 17th, 2020
1,032
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. """ Code-snippet-vol_43-snip_214-Selenium special.
  2.  
  3. Open Amazon.com, enter a search term and click search.
  4.  
  5. By Steve Shambles Feb 2020
  6. stevepython.wordpress.com
  7.  
  8. Requirements:
  9. -------------
  10. pip3 install selenium
  11. geckodriver.exe in python path.
  12. firefox browser
  13. """
  14. from selenium import webdriver
  15. from selenium.webdriver.common.keys import Keys
  16.  
  17. driver = webdriver.Firefox()
  18. driver.get('https://www.amazon.com')
  19.  
  20. search_box = driver.find_element_by_id('twotabsearchtextbox')
  21. search_box.clear()
  22. search_box.send_keys('moto g', Keys.ENTER)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement