Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Follow to the redirect links in scrapy

Tags:

python

scrapy

How i can set this? i have written handle_httpstatus_list = [301, 302, 303], but scrapy does not follow to the new links, it just has begun to save empty files of pages.

P.S. English is not my native language. Exuse me for that.

like image 982
user709203 Avatar asked Apr 15 '11 05:04

user709203


2 Answers

Scrapy does handle redirects by default, meaning that the RedirectMiddleware is activated in the DOWNLOADER_MIDDLEWARES setting and the REDIRECT_ENABLED setting is set to True.

like image 172
Steven Almeroth Avatar answered Oct 23 '22 20:10

Steven Almeroth


You will also need to mention dont_redirect = true in your request as:

meta = {'dont_redirect': True, "handle_httpstatus_list" : [301, 302, 303]}

Regards

like image 4
Orochi Avatar answered Oct 23 '22 20:10

Orochi