Answers for "how to log in on a website selenium"

1

logging in with selenium

driver.get (“URL”)
driver.find_element_by_id(“ID”).send_keys(“username”)
driver.find_element_by_id (“ID”).send_keys(“password”)
driver.find_element_by_id(“submit”).click()
Posted by: Guest on December-07-2020
0

selenium login to website

# Dependencies
from selenium import webdriver
driver = webdriver.Chrome()
# Target page
driver.get("https://ilovefluffycats.com/authentication/signon")
assert "cats" in driver.title
# Complete username
username = driver.find_element_by_id("uid")
username.clear()
username.send_keys("mrcats")
# Complete password
password = driver.find_element_by_name("pwd")
password.clear()
password.send_keys("catskillz")
# Click login
driver.find_element_by_name("submitButton").click()
# Also possible to click by text
# driver.find_element_by_link_text("Grumpy cats").click()
Posted by: Guest on January-28-2021

Code answers related to "how to log in on a website selenium"

Python Answers by Framework

Browse Popular Code Answers by Language