Whats the difference between getting text and innerHTML when using selenium. Even though we have text under particular element, when we perform .text we get empty values. But doing .get_attribute("innerHTML") works fine. 
Can someone point out the difference between two? When someone should use '.get_attribute("innerHTML")' over .text?
For instance, <div><span>Example Text</span></div>
.get_attribute("innerHTML") gives you the actual HTML inside the current element. So theDivElement.get_attribute("innerHTML") returns "<span>Example Text</span>"
.text gives you only text, not include HTML node. So theDivElement.text returns "Example Text"
Please note that the algorithm for .text depends on webdriver of each browser. In some cases such as element is hidden, you might get different text when you use different webdriver.
I usually get text from .get_attribute("innerText") instead of .text so I can handle the all the case.
Difference between text and innerHTML using Selenium