Scrapy and response status code: how to check against it?

后端 未结 2 893
感情败类
感情败类 2020-12-08 15:38

I\'m using scrapy to crawl my sitemap, to check for 404, 302 and 200 pages. But i can\'t seem to be able to get the response code. This is my code so far:

fr         


        
2条回答
  •  情书的邮戳
    2020-12-08 16:15

    Only to have a complete response here:

    • Set Handle_httpstatus_list = [302];

    • On request, set dont_redirect to True on meta.

    For example: Request(URL, meta={'dont_redirect': True});

提交回复
热议问题