title: Xpath: select div that contains class AND whose specific child element contains text
body: <p>With the help of <a href="https://stackoverflow.com/questions/19503721/xpath-find-a-node-whose-class-attribute-matches-a-value-and-whose-text-contains">this SO question</a> I have an almost working xpath:</p>
  
  <pre><code>//div[contains(@class, 'measure-tab') and contains(., 'someText')]
  </code></pre>
  
  <p>However this gets two <code>divs</code>: in one it's the child <code>td</code> that has someText, the other it's child <code>span</code>.</p>
  
  <p>How do I narrow it down to the one with the <code>span</code>?</p>
  
  <pre><code>&lt;div class="measure-tab"&gt;
    &lt;!-- table html omitted --&gt;
    &lt;td&gt; someText&lt;/td&gt;
  &lt;/div&gt;
  
  &lt;div class="measure-tab"&gt;  &lt;-- I want to select this div (and use contains @class)
    &lt;div&gt;
      &lt;span&gt; someText&lt;/span&gt;  &lt;-- that contains a deeply nested span with this text
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>