title: How can I get a clean URL from a href selector with Scrapy?
body: <p>When I inspect the source code on the results page of a Google search, I see the URL I'm looking for. Something like this:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;a href=&quot;https://www.amazon.co.uk/&lt;product_name&gt;/dp/&lt;product_code&gt;&quot; ping=...&gt; &lt;/a&gt;
  </code></pre>
  <p>But when I use Scrapy to retrieve that same URL with the following selector:</p>
  <pre class="lang-py prettyprint-override"><code>response.xpath(&quot;//a[contains(@href, 'amazon.com')]/@href&quot;).get()
  </code></pre>
  <p>I get the following URL that doesn't work:</p>
  <pre class="lang-py prettyprint-override"><code>'/url?q=https://www.amazon.com/&lt;product_name&gt;/dp/&lt;product_code&gt;&amp;sa=U&amp;ved=2ahUKEwjbjbqFzPLsAhWQpFkKHUgfA50QFjAAegQIARAB&amp;usg=AOvVaw0cZpoBVRm94Z7lbphHTjsW'
  </code></pre>
  <p>Considering I don't want to slice the strings manually:</p>
  <ol>
  <li>How can I get the URL without the <code>/url?q=</code>at the very beginning?</li>
  <li>And how can I get the URL without the last piece of random stuff?</li>
  </ol>