Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from seleniumrequests import Chrome
- from selenium.webdriver.common.keys import Keys
- from selenium.webdriver.common.by import By
- driver = Chrome('D:/Coding/chromedriver_win32/chromedriver.exe')
- driver.get("http://localhost")
- # username = driver.find_element(By.NAME, "username")
- # password = driver.find_element(By.NAME, "password")
- # username.send_keys('admin')
- # password.send_keys('password')
- # password.send_keys(Keys.ENTER)
- token = driver.find_element(By.NAME, "user_token")
- user_details = {
- "username": "admin",
- "password": "password",
- "user_token": token.get_attribute("value")
- }
- response = driver.request("POST", "http://localhost/login.php", data=user_details)
- print(response)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement