title: Xpath: select h2 parent with no a child
body: <p>I have the following html:</p>
  
  <pre><code>&lt;div class="stack"&gt;
      &lt;h2 class="overflow"&gt;
         &lt;img src="http:.."&gt;
         text
      &lt;/h2&gt;
      &lt;div class="sublist"&gt;
          &lt;table&gt;
          ...
          &lt;/table&gt;
      &lt;/div&gt;
  
      &lt;h2 class="overflow"&gt;
          &lt;a href="http://..."&gt;link&lt;/a&gt;
      &lt;/h2&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>As you can see, the .sublist div always follows a  with  and some text, it's like the div is a sublist of the h2(the h2 is the title of the sublist). The other  contains an anchor tag. </p>
  
  <p>I'd like to get all the h2 tags which preceeds the div .sublist.</p>
  
  <p>This is my current xpath clause:</p>
  
  <pre><code>//div[@class="stack"]/h2/*[not(descendant::a)]
  </code></pre>
  
  <p>And I end up getting different elements(a, div, img) but the h2 elements.</p>