0

I'm trying to automate a login with Selenium in python, but the the tag type is "email", and dosen't have the 'send_keys' atribute nether the 'click' atribute

I selected the tag with xpath:

email_xpath = '//input[@name="email_address"]'
email_box = driver.find_elements_by_xpath(email_xpath)

when i try to force i receive this message:

traceback (most recent call last):
  File "/home/gabriel/PycharmProjects/Webnars/webnarJam Sing Up.py", line 78, in <module>
    email_box.send_keys(target[1])
AttributeError: 'list' object has no attribute 'send_keys'

Has some way to type our send keys to a input tag type "email"?

2
  • 'list' object seems to me as if there are multiple of such elements (find_elements...) that match the XPath. Try email_box[0].send_keys(...) Commented Aug 15, 2019 at 21:38
  • I can belive i do that. I spend more than 3 hours loking for it. Thank you for the help Commented Aug 16, 2019 at 16:08

1 Answer 1

-1

driver.find_elements_by_xpath() returns a list of elements.

If you only expect to find one element, use find_element_by_xpath() instead.

Otherwise, if you do expect to find multiple elements, you'll have to pull each element out of the list.

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

1 Comment

I can belive i do that. I spend more than 3 hours loking for it. Thank you for the help

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.