Skip to content
Advertisement

Selenium + Python – entering text in form with no label/id?

I”m trying to enter some text in the box as shown below. I’ve narrowed the element down to SMDMainText. I’ve tried numerous ways of finding the element, however when I try to send_keys(), the result is that I get the error “element not interactable”. The issue that I’m facing is that I’m trying to find an element called <input automplete="on"> and don’t quite understand how to send text to it.

element = browser.find_element_by_class_name("styledModalDialogueDIV")
element = browser.find_element_by_css_selector("form")
element = browser.find_element_by_id("SMDMain")
element = browser.find_element_by_id("SMDMainText")
element = browser.find_element_by_css_selector("input")

# comment all but 1 line above, and try below:
element.send_keys("Hello World")  # same error is produced for each try

enter image description here

Advertisement

Answer

You need to target the input tag.

element = browser.find_element_by_css_selector("#SMDMainText>div>input")
Advertisement