Advertisement
Guest User

Untitled

a guest
Jan 21st, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. import os
  2. from time import sleep
  3. from selenium import webdriver
  4. from selenium.webdriver import ActionChains
  5. from selenium.webdriver.support.ui import WebDriverWait
  6. from selenium.webdriver.support import expected_conditions as EC
  7. from selenium.webdriver.common.keys import Keys
  8.  
  9. from selenium.webdriver.common.by import By
  10. driver = webdriver.Firefox()
  11. actionChains = ActionChains(driver)
  12.  
  13. driver.get("http://neuralnetworksanddeeplearning.com/chap1.html")
  14.  
  15. sleep(1)
  16.  
  17. # formulas = driver.find_elements(By.CLASS_NAME, 'MathJax_FullWidth')
  18.  
  19.  
  20. formulas = driver.find_element(By.TAG_NAME, 'img')
  21.  
  22. # print(len(formulas))
  23. # for formula in formulas[-5:]:
  24. # actionChains.context_click(formula).perform()
  25. # sleep(1)
  26. # actionChains.context_click(formulas[9]).perform()
  27. # actionChains.context_click(formulas).perform()
  28.  
  29. formulas.send_keys(Keys.)
  30.  
  31. sleep(2)
  32. driver.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement