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.