Fill username and password using selenium in python

0
0

How can I auto fill the username and password over the link below:

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
chromedriver
= 'C:\\chromedriver.exe'
browser
= webdriver.Chrome(chromedriver)
browser
.get('http://www.example.com')

After that I really do not know:

username = Select(browser.find_element_by_name('Username'))
password
= Select(browser.find_element_by_name('Password'))
username
.select_by_visible_text("text")
password
.select_by_visible_text("text")
  • You must to post comments
0
0
username = selenium.find_element_by_id("username")
password
= selenium.find_element_by_id("password")
username
.send_keys("YourUsername")
password
.send_keys("Pa55worD")
selenium
.find_element_by_name("submit").click()

Notes to your code:

  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Website