Using Selenium Web Driver to retrieve value of a HTML input (Python)

Using Selenium Web Driver to retrieve value of a HTML input (Python)

To get the text entered into an input element, use element.get_attribute("value") where element is the input element. The attribute text is used to get the text from the tags within an element.

query = self.driver.find_element("id", "searchInput")
query.send_keys("The Moon")
print(query.get_attribute("value"))

See Working Example



Using Java

Leave a reply

Your email address will not be published. Required fields are marked*

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.