title: scrapy : how to include hashtag in URL
body: <p>I have a URL of the form</p>
  
  <pre><code>url = "http://www.example.com/search.html#query=test"
  </code></pre>
  
  <p>When passing this to scrapy.Request as </p>
  
  <pre><code>yield scrapy.Request(url, self.parse_result)
  </code></pre>
  
  <p>and picking it up in <code>parse_result</code> like this</p>
  
  <pre><code>def parse_result(self, response):
      print(response.url)
  </code></pre>
  
  <p>the last bit in the string is always stripped, and is printed as follows</p>
  
  <pre><code>http://www.example.com/search.html
  </code></pre>
  
  <p>What do I need to do to be able to pick up the string in full from <code>response.url</code> meaning including the <code>#query=test</code> part? Tried to use the %23 code instead of the hashtag, but that is just being passed on as the number but not as a hashtag. And using </p>
  
  <pre><code>urllib.parse.quote(url)
  </code></pre>
  
  <p>creates a value error:</p>
  
  <pre><code>ValueError: Missing scheme in request
  </code></pre>