You can read innerHTML attribute to get source of the content of the element or outerHTML for source with the current element.
Python:
element.get_attribute('innerHTML')
Java:
elem.getAttribute("innerHTML");
C#:
element.GetAttribute("innerHTML");
Ruby:
element.attribute("innerHTML")
JS:
element.getAttribute('innerHTML');
PHP:
$elem.getAttribute('innerHTML');
Tested and works with the ChromeDriver
I hope this helps!
Check out the Selenium Training for more.