The error is coming because of this line driver.find_elements_by_name("email")
. The find_elements command in selenium is used to extract multiple elements with same kind of locators which return a list of objects.
Over here in you case, you are accessing a single element and for the extraction you need to use driver.find_element_by_name("email")
.
A sample script is given below:
from selenium import webdriver
driver = webdriver.Chrome()
driver.get("https://www.fb.com")
driver.find_element_by_name("email").send_keys("******************")
driver.close()
Just a additional information, close()
command closes the window under focus and quit()
command closes window active in session. So you can use driver.quit()
command either.