python - how does open_spider metho fired on item pipeline -
i using scrapy 0.20 python 2.7
according scrapy architecture, spider sends requests engine. then, after whole crawling process, item goes through item pipeline.
so, item pipeline has nothing when spider opens or closes. also, item pipeline components can't know when spider opens or closes. so, how open_spider
method exists in item pipeline components according this page?
it's saying can implement open_spider() , close_spider() callbacks if want to. if don't, item pipeline operate without awareness of spider opens , closes. if implement these routines, called when spider opens , closes. if want item pipeline take special action @ when spider opens , closes, can make happen writing these routines in pipeline.
Comments
Post a Comment