Scrapy SgmlLinkExtractor how to scrape li tags with changing id's
<p>How can I get an element at this specific location:</p>

<p><a href="http://i.stack.imgur.com/CkzTH.png" rel="nofollow">Check picture</a></p>

<p>The XPath is:</p>

<pre><code>//*[@id="id316"]/span[2]
</code></pre>

<p>I got this path from google chrome browser. I basically want to retreive the number at this specific location with the following statement:</p>

<p><code>zimmer = response.xpath('//*[@id="id316"]/span[2]').extract()</code></p>

<p>However I'm not getting anything but an empty string. I found out that the id value is different for each element in the list I'm interested in. Is there a way to write this expression such that it works for generic numbers?</p>

<p>Use the corresponding label and get the <a href="https://developer.mozilla.org/en-US/docs/Web/XPath/Axes/following-sibling" rel="nofollow">following sibling</a> element containing the value:</p>

<pre><code>//span[. = 'Zimmer']/following-sibling::span/text()
</code></pre>

<p>And, note the bonus to the readability of the locator.</p>

python xpath scrapy