Search code examples
pythonseleniumwebdriverinstagramsendkeys

Selenium Instagram Login: 'WebElement' object has no attribute 'send_Keys'


I am trying to automate instagram login with little success

Error message:

AttributeError: 'WebElement' object has no attribute 'send_Keys'

from selenium import webdriver
import time
from selenium.webdriver.common.keys import Keys

driver = webdriver.Chrome()

driver.get("https://www.instagram.com/")

driver.find_element_by_xpath("""/html/body/div[4]/div/div/button[1]""").click() #click cookies
time.sleep(2)
username = driver.find_element_by_name("username").send_Keys("username")
password = driver.find_element_by_name("passwrod").send_keys("Password")

driver.find_element_by_xpath("""//*[@id="loginForm"]/div/div[3]/button/div""").click()#login

Solution

  • There is nothing called .send_Keys. Please use .send_keys

    It is case sensitive.

    username = driver.find_element_by_name("username")
    username.send_keys('insta user name')
    password = driver.find_element_by_name("passwrod")
    password.send_keys('insta password')