0

what is the right code to find the email input for https://accounts.google.com/ServiceLogin?

the html is <input id="Email" class="" type="email" spellcheck="false" value="" placeholder="Email" name="Email"></input>

I'm referencing https://pypi.python.org/pypi/selenium

from selenium import webdriver
browser = webdriver.Firefox()
browser.get('https://accounts.google.com/ServiceLogin?')

for elem = browser.find_element_by_name() i've tried:

elem=browser.find_element_by_name('input id="Email"')
elem=browser.find_element_by_name('input id="Email" class="" type="email" spellcheck="false" value="" placeholder="Email" name="Email"')
elem=browser.find_element_by_name('input id="Email" class=""')
elem=browser.find_element_by_name('id="Email" class="" type="email" spellcheck="false" value="" placeholder="Email" name="Email"')
elem=browser.find_element_by_name('id="Email" class=""')

none of these work.

2 Answers 2

1

Try this:

elem=browser.find_element_by_name("Email")

find_element_by_name expects the value of the name in the line of HTML. So in the case of name="Email", you would give find_element_by_name("Email").

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

Comments

0

You can also try using the id of the tag

elem = browser.find_element_by_id("Email")

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.