Created
September 30, 2021 13:18
-
-
Save cristianzsh/eb27943a074ca905e543125b59e8b3d4 to your computer and use it in GitHub Desktop.
Exemplo de login com Selenium
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
import time | |
driver = webdriver.Firefox() | |
driver.get("http://testphp.vulnweb.com/login.php") | |
elem = driver.find_element_by_name("uname") | |
elem.clear() | |
elem.send_keys("test") | |
time.sleep(2) | |
elem = driver.find_element_by_name("pass") | |
elem.clear() | |
elem.send_keys("test") | |
elem.send_keys(Keys.RETURN) | |
time.sleep(10) | |
driver.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment