I can select the first class="hm-Login_InputField "> fine and pass in user name
<div class="hm-Login ">
<div class="hm-Login_UserNameWrapper ">
<input type="text" class="hm-Login_InputField ">
<div class="hm-Login_InputText ">Join</div>
</div>
<div class="hm-Login_PasswordWrapper ">
<input type="text" class="hm-Login_InputField ">
<input type="password" class="hm-Login_InputField Hidden ">
<button tabindex="0" class="hm-Login_LoginBtn ">GO</button>
<div class="hm-Login_InputText ">Lost Login?</div>
</div>
</div>
elem = driver.find_element_by_class_name("hm-Login_InputField")
elem.click()
elem.send_keys("xxxxx")
I've tired copying the Xpath for the 2nd text input / password textbox. with inconstant results, sometimes it works, sometimes it doesn't.
/html/body/div[1]/div/div[1]/div/div[1]/div[2]/div/div[2]/input[2]
How can I select the 2nd class="hm-Login_InputField? text input / password textbox?
Do I need a relative Xpath? How is this derived?
I've tried:
elem = driver.find_element_by_class_name("hm-Login_InputField Hidden ")
elem.click()
elem.send_keys("xxxxx")
NoSuchElementException: no such element: Unable to locate element: {"method":"css selector","selector":".hm-Login_InputField Hidden "} (Session info: chrome=77.0.3865.120)