driver.get('http://google.com')
input_from_find = driver.find_element_by_id('gbqfq')
input_from_find.send_keys('foo')
html = driver.execute_script('return document.documentElement.outerHTML')
tree = lxml.etree.parse(StringIO(html), parser)
field = tree.find("//*[@id='gbqfq']")
path = tree.getpath(field)
input_from_xpath = driver.find_element_by_xpath(path)
print('Equal?', input_from_xpath == input_from_find)
print('Value:', input_from_xpath.get_attribute('value'))
driver.quit()
Need to dump entire DOM tree with element id from selenium server