简体   繁体   中英

Finding Element for username and password with Python and Selenium.

I have attached 2 screenshots that show the html code of the website and am wondering which "find driver element" formats I would use in order to have my username and password sent to the appropriate boxes.

Image1

Image2

Thank you so much.

I am unable to understand your question. If you are asking that which locator type you should use, then as per best automation practices following is the preference of locator types should be followed,

ID>NAME>CSS>XPATH>Link_TEXT>Partial_Link_Text

So, you should use,

driver.find_element_by_name('username')
driver.find_element_by_name('password')

Kindly let me know if I am missing something

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM