Reset items_scraped instead of item_count

items_scraped is the counter that needs to be reset each time we have scraped a specific number of items in the code instead of item_count (which represents the specific number of items needed before a message is logged). Updating the source code to reflect this.
Removed some irrelevant words from the log message.
Signed-off-by: Sudhanshu Shekhar <sudshekhar02@gmail.com>
This commit is contained in:
Sudhanshu Shekhar 2015-01-14 02:31:03 +05:30 committed by Daniel Graña
parent 7ee6f7af97
commit edb07a452c
1 changed files with 3 additions and 3 deletions

View File

@ -145,9 +145,9 @@ Here is the code of such extension::
def item_scraped(self, item, spider):
self.items_scraped += 1
if self.items_scraped == self.item_count:
spider.log("scraped %d items, resetting counter" % self.items_scraped)
self.item_count = 0
if self.items_scraped % self.item_count == 0:
spider.log("scraped %d items" % self.items_scraped)
.. _topics-extensions-ref: