crawl.py 545 B

1234567891011121314151617
  1. from selenium import webdriver
  2. from selenium.webdriver.common.keys import Keys
  3. import time
  4. driver = webdriver.Firefox()
  5. driver.get("http://50.211.199.148:3002/#/search/documents")
  6. time.sleep(2)
  7. driver.implicitly_wait(2)
  8. # driver.find_element_by_id("nav-search").send_keys("Selenium")
  9. enter_text = driver.find_element(
  10. "xpath", "//input[@placeholder='Example: Apple, CUDA']"
  11. ).send_keys("Apple")
  12. time.sleep(2)
  13. driver.implicitly_wait(2)
  14. enter_button_search = driver.find_element(
  15. "xpath", "(//button[@class='btn btn-info'])[2]"
  16. ).click()