Advertisement
Guest User

Untitled

a guest
Feb 28th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. Python 2.7.5 (default, Oct 11 2015, 17:47:16)
  2. [GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux2
  3. Type "help", "copyright", "credits" or "license" for more information.
  4. >>>
  5.  
  6. [hkeyland@localhost Escritorio]$ python testa.py
  7.  
  8. from selenium import webdriver
  9. from selenium.webdriver.common.action_chains import ActionChains
  10. from selenium.webdriver.common.action_chains import ActionChains
  11. from selenium.webdriver.common.keys import Keys
  12.  
  13. ########################################
  14. """USER AUTH"""
  15. username="user"
  16. password="password"
  17. ########################################
  18.  
  19. ########################################
  20. """LOGIN"""
  21. driver = webdriver.Firefox()
  22. driver.set_window_size(1024,800)
  23. driver.get("https://www_hackthissite_org/missions/prog/2/index.php")
  24. element = driver.find_element_by_name('username')
  25. element.send_keys(username)
  26. element2 = driver.find_element_by_name("password")
  27. element2.send_keys(password)
  28. element3 = driver.find_element_by_name("btn_submit")
  29. element3.click()
  30. ########################################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement