Might be useful as well:
In some cases, one may find it useful to get the hidden text, which can be retrieved from element’s textContent
, innerText
or innerHTML
attribute, by calling element.attribute('attributeName')
.
element.getAttribute("textContent")
worked for me.
See more details there ->
http://yizeng.me/2014/04/08/get-text-from-hidden-elements-using-selenium-webdriver/