0

I am trying to find the following element in seleniumenter image description here

It is a user name input field and I use: loginLink = driver.find_element(By.name, "loginEmail" but keep getting "no such element" message.

2 Answers 2

2
//input[@ng-reflect-name='loginEmail']

Use xpath or CSS , you can find by name only if the attribute key is 'name'

Eg 'name=loginEmail'

driver.find_element_by_xpath("//input[@ng-reflect-name='loginEmail']")

driver.find_element_by_css_selector("input[ng-reflect-name='loginEmail']")

you can use xpath and css for any attribute as

xpath: //tagname[@attriubute='value'] css: tagname[attriubute='value']

Sign up to request clarification or add additional context in comments.

Comments

0

Using the xpath given by PDHide the code you need to use is

loginLink = driver.find_element_by_xpath("//input[@ng-reflect-name='loginEmail']")

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.