title: Capture links in scrapy using regex as selector
body: <pre><code>&lt;svg version=&quot;1.1&quot; id=&quot;Calque_1&quot; xmlns=&quot;&amp;amp;ns_svg;&quot; xmlns:xlink=&quot;&amp;amp;ns_xlink;&quot; width=&quot;700&quot; height=&quot;700&quot; viewBox=&quot;0 0 300 300&quot; overflow=&quot;visible&quot; enable-background=&quot;new 0 0 300 300&quot; xml:space=&quot;preserve&quot;&gt;
  &lt;a xlink:href=&quot;https://www.pros-locations-de-voitures.fr/location-de-voiture-ain-01/&quot; onmouseover=&quot;TipFunction('Ain')&quot; onmouseout=&quot;TipFunction('')&quot;&gt;&lt;path id=&quot;Z1&quot; title=&quot;Ain&quot; d=&quot;M237.125,152.725l-1.7-1l-2.4,3.3l-2.7,1.6l-2,0.1l-0.2-1.4l-1.6-0.8l-2,2.2l-1.5,0.1v-1.5h-1.5l-2.1-3.9 l-2.5-1.6l-2.7,0.6l-2.9-0.8l-2.9,10.5l-0.8,4l1.5,4.6l1.5-0.3l1.8,2.9l3.2-0.3l3,1l1.5-2.5l1.4-0.4l5.6,7.6l2.9-3.3l1.1-6.8    l-0.4-4.7h1.5l1.3-1.4h-0.1l0.3-2.6l2.8-1.7L237.125,152.725z&quot; fill=&quot;red&quot; stroke=&quot;#EEEEEE&quot; stroke-width=&quot;0.9&quot;&gt;&lt;/path&gt; &lt;/a&gt;
  &lt;a xlink:href=&quot;https://www.pros-locations-de-voitures.fr/location-de-voiture-aisne-02/&quot; onmouseover=&quot;TipFunction('Aisne')&quot; onmouseout=&quot;TipFunction('')&quot;&gt;&lt;path id=&quot;Z2&quot; title=&quot;Aisne&quot; d=&quot;M179.025,42.325l-6.3,0.4l-0.2,1.8l-1.9,4.1l1.1,3.5l0.2,5.1l-0.3,2.2l1.1,0.9l-1.3,0.6l-1.2,2.8l-1.3,0.8    l1.4,2.3l-1.5-0.1l0.4,1.5l1.2-0.8l1.4,0.6l0.3,1.4l-1.1,0.8l1.3,0.4l0.9,1.2l-0.3,1.4l1.9,2.1l4.7,3l3.8-5.1l-1.3-0.6l0.5-1.4    l-0.8-1.2l2.7-1.1l-1.6-4l0.6-1.4l4-2l2.7,1l0.4-1.5l-0.1-7.1l1.4-0.1l2.5-3.6l-0.7-1.6l0.7-1.7l-0.4-2.9h-0.2l-1.8-0.6v-0.1    l-7.8-2.1l-2.6,0.9l-1.2-0.9L179.025,42.325z &quot; fill=&quot;#094353&quot; stroke=&quot;#EEEEEE&quot; stroke-width=&quot;0.9&quot;&gt;&lt;/path&gt; &lt;/a&gt;
  </code></pre>
  <p>While testing the regex pattern its working fine and matches the links but while applying in code it returning empty list.</p>
  <pre><code>import scrapy
  
  class scraper(scrapy.Spider):
      name = &quot;scraper&quot;
      start_urls = [&quot;https://www.pros-locations-de-voitures.fr/&quot;]
      
      def parse(self, response):
          yield {
              'Links' : response.selector.re('(?&lt;=xlink:href=&quot;).*?(?=&quot;)')
          }
  </code></pre>