title: Python Scrapy 301 redirects
body: <p>I have a little problem in printing the redirected urls (new URLs after 301 redirection) when scraping a given website. My idea is to only print them and not scrape them. My current piece of code is:</p>
  
  <pre><code>import scrapy
  import os
  from scrapy.spiders import CrawlSpider, Rule
  from scrapy.linkextractors import LinkExtractor
  
  class MySpider(CrawlSpider):
      name = 'rust'
      allowed_domains = ['example.com']
      start_urls = ['http://example.com']
  
      rules = (
          # Extract links matching 'category.php' (but not matching 'subsection.php')
          # and follow links from them (since no callback means follow=True by default).
          # Extract links matching 'item.php' and parse them with the spider's method parse_item
          Rule(LinkExtractor(), callback='parse_item', follow=True),
      )
  
      def parse_item(self, response):
          #if response.status == 301:
          print response.url
  </code></pre>
  
  <p>However, this does not print the redirected urls. Any help will be appreciated.</p>
  
  <p>Thank you.</p>