Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get spider name in scrapy feed exporter

Tags:

python

scrapy

Is it possible to access the name of the current spider in a feed exporter?

like image 785
zsquare Avatar asked Jan 23 '12 08:01

zsquare


1 Answers

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
like image 54
Sjaak Trekhaak Avatar answered Sep 28 '22 03:09

Sjaak Trekhaak