程序运行一段时间后,CPU使用率为100%,程序似乎不会抓取页面。
当我杀死程序时,我得到以下日志:
2018-05-06 18:21:43 [scrapy.statscollectors] INFO: Dumping Scrapy stats:
{'downloader/exception_count': 479,
'downloader/exception_type_count/twisted.internet.error.ConnectError': 1,
'downloader/exception_type_count/twisted.internet.error.ConnectionRefusedError': 146,
'downloader/exception_type_count/twisted.internet.error.TimeoutError': 332,
'downloader/request_bytes': 7834053,
'downloader/request_count': 14825,
'downloader/request_method_count/GET': 14825,
'downloader/response_bytes': 155349329,
'downloader/response_count': 14346,
'downloader/response_status_count/200': 14316,
'downloader/response_status_count/302': 21,
'downloader/response_status_count/400': 9,
'dupefilter/filtered': 90830,
'finish_reason': 'shutdown',
'finish_time': datetime.datetime(2018, 5, 6, 10, 21, 43, 859725),
'item_scraped_count': 1781,
'log_count/DEBUG': 15880,
'log_count/INFO': 14672,
'memusage/max': 601972736,
'memusage/startup': 55906304,
'request_depth_max': 428,
'response_received_count': 14091,
'scheduler/dequeued': 14825,
'scheduler/dequeued/memory': 14825,
'scheduler/enqueued': 143352,
'scheduler/enqueued/memory': 143352,
'start_time': datetime.datetime(2018, 5, 6, 9, 8, 22, 330943)}
2018-05-06 18:21:44 [scrapy.core.engine] INFO: Spider closed (shutdown)
答案 0 :(得分:0)
您可以检查一下您的文件(或在此处加入):dont_filter=True
如果是这样,scrapy不会过滤掉重复的请求。
请包含您的scrapy文件。