Here is my stats collector definition:

class ItemStatsCollector(StatsCollector):
    def __init__(self, stats):
        super(ItemStatsCollector, self).__init__(stats)
        self.stats = stats

    @classmethod
    def from_crawler(cls, crawler):
        ext = cls(crawler.stats)
        
        crawler.signals.connect(ext.item_scraped, 
signal=signals.item_scraped)
        crawler.signals.connect(ext.request_scheduled, 
signal=signals.request_scheduled)
        
        return ext
        
    def item_scraped(self, item, spider):
        self.stats.inc_value('items_scraped')
        
    def request_scheduled(self, request, spider):
        self.stats.inc_value('request_scheduled')

When I run the spider, I find that, in my spider class, as the crawling 
goes, `self.crawler.stats.get_value('request_scheduled')` never change. 
Could you please help me fix this problem?
PS: I have already set the value of `request_scheduled` to 0 in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"scrapy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to scrapy-users+unsubscr...@googlegroups.com.
To post to this group, send email to scrapy-users@googlegroups.com.
Visit this group at http://groups.google.com/group/scrapy-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to