scrapy开启时或者关闭时的勾子

潘先生 日期:2017-06-28

scrapy开启时或者关闭时的勾子

在spider class中

def closed(self,reason):

当spider关闭的时候,执行此函数。


spider_opened(self,reason)

spider_closed(reason)


在pipeline中

open_spider(self, spider)

This method is called when the spider is opened.


close_spider(self, spider)

This method is called when the spider is closed.

关键词: scrapy,

属分类: scrapy

0 0
网圵:http://127.0.0.13/Article/show/i/437.html
留言:
登录  注册
三思而后言,谢谢。