<div id="a">This is some
<div id="b">text</div>
</div>
Getting "This is some" is non-trivial. For instance, this returns "This is some text":
driver.find_element_by_id('a').text
How does one, in a general way, get the text of a specific element without including the text of it's children?
(I'm providing an answer below but will leave the question open in case someone can come up with a less hideous solution).