Scrapy SgmlLinkExtractor how to define rule with regex
<p>I have a link like <code>http://www.example.com/kaufen/105975478</code></p>

<p>I only want to allow links that have "/kaufen/" in the url and which contain a 9 digit integer number at the end of the url. </p>

<p>I managed to allow only links containing "/kaufen/" with the following allow statement:</p>

<pre><code>allow=('/kaufen/', )
</code></pre>

<p>How can I extend the allow statement such that it only follows the links having a 9 digit number at the end?</p>

<p>You can use:</p>

<pre><code>allow=(r'kaufen/\d+$')
</code></pre>

python regex scrapy