简体   繁体   中英

Get spider name in scrapy feed exporter

是否可以在Feed导出器中访问当前蜘蛛的名称?

The doc about storage URI parameters might help.

Or, if you are building your own: The methods used by exporters support passing the spider object to it. For example:

def open_spider(self, spider):
   print spider.name

def close_spider(self, spider):
   print spider.name

def item_scraped(self, item, spider):
   print spider.name

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM