С помощью this SO question у меня есть почти рабочий xpath:
//div[contains(@class, 'measure-tab') and contains(., 'someText')]
Однако это получает два divs: в одном это дочерний td, который имеет некоторыйText, другой - дочерний span.
Как я могу сузить его до span?
<div class="measure-tab">
  <!-- table html omitted -->
  <td> someText</td>
</div>
<div class="measure-tab">  <-- I want to select this div (and use contains @class)
  <div>
    <span> someText</span>  <-- that contains a deeply nested span with this text
  </div>
</div>