I'm new python (programming). Currently working on a project to fill up forms using selenium and python.
So for everything seems okay. I successfully installed python 3.6, selenium on pycharm and chrome drive on my windows.
I try to open a website and fill the form using the script. The script opens the site but couldn't put the texts in the form.
I have been browsing stack overflow and googling for hours and anything doesn't work.
It shows error regarding sendkeys.
Here's the full code
from selenium import webdriver
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
import time
# Replace below path with the absolute path
# to chromedriver in your computer
driver = webdriver.Chrome('C:\\Users\public\chromedriver.exe')
# Go to your page url
driver.get('https://www.website.com/')
# Get button you are going to click by its id ( also you could us find_element_by_css_selector to get element by css selector)
button_element = driver.find_element_by_class_name('signup_email_link')
button_element.click()
input_element = driver.find_element_by_name("first_name")
input_element.sendkeys(ram)
Here's the error code,
C:\Users\user\AppData\Local\Programs\Python\Python36-32\python.exe "C:/Users/user/PycharmProjects/My Projects/My scripts automate.py"
Traceback (most recent call last):
File "C:/Users/user/PycharmProjects/My Projects/My scripts automate.py", line 22, in <module>
input_element.sendkeys(ram)
AttributeError: 'WebElement' object has no attribute 'sendkeys'
Process finished with exit code 1
I even tried to replace the input_element with web_element but error continuous.
I use latest Python 3.6 version on pycharm.