.get_attribute("value")
from selenium import webdriver import time driver=webdriver.Firefox() driver.get("http://www.baidu.com") driver.find_element_by_id("kw").send_keys("hello") time.sleep(1) var=driver.find_element_by_id("kw").get_attribute("value") print(var) driver.quit()