title: Scrapy writing XPath expression for unknown depth
body: <p>I have an html file which is like:</p>
  
  <pre><code>&lt;div id='author'&gt; 
     &lt;div&gt;
        &lt;div&gt;
           ...
  
               &lt;a&gt; John Doe &lt;/a&gt;
  </code></pre>
  
  <p>I do not know how many div's would be under the author div. It may have different depth for different pages.</p>
  
  <p>So what would be the XPath expression for this kind of xml?</p>
  
  <p>By the way, I tried:</p>
  
  <pre><code>//div[@id = "author"]/*/a/text()
  </code></pre>
  
  <p>but this only seems to work for grandchildren of the author div.</p>