mirror of https://github.com/scrapy/scrapy.git
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:
parent
7ee6f7af97
commit
edb07a452c
|
|
@ -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:
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue