LiuXingMing / SinaSpider

新浪微博爬虫(Scrapy、Redis)
3.27k stars 1.52k forks source link

process_response() 函数中有语法错误 #46

Open shizi626 opened 7 years ago

shizi626 commented 7 years ago

image

红圈的地方没有"location"这个关键词。 200的response如下: {'Proc_Node': ['web359.mweibo.bx.sinanode.com'], 'Set-Cookie': ['_T_WM=339ff7f97fb5c147c8e465d4e9eb1aaa; expires=Fri, 07-Apr-2017 03:27:31 GMT; path=/; domain=.weibo.cn; httponly', 'WEIBOCN_FROM=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.weibo.cn'], 'Lb_Node': ['layer7-002.mweibo.hk.sinanode.com'], 'Vary': ['Host,Accept-Encoding'], 'X-Log-Uid': ['6039348406'], 'Server': ['Tengine'], 'Date': ['Wed, 08 Mar 2017 03:27:31 GMT'], 'Content-Type': ['text/html; charset=utf-8'], 'Age': ['3']}

另外 raise IgnoreRequest会让scrapy直接忽略这个语法错误,不利于debug。