def close_spider(self, spider): PrintFormatUtil.print_line(self.__class__.__name__) total = self.counter[spider.name].total() PrintFormatUtil.print_line("total %s record inserted" % total) PrintFormatUtil.print_title(" spider %s finished " % spider.name)
def open_spider(self, spider): PrintFormatUtil.print_title(" spider %s started " % spider.name) PrintFormatUtil.print_line(self.__class__.__name__) self.counter[spider.name] = SpiderCounter() self.counter[spider.name].create_counter()