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