run_all_spiders.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:alltheplaces 作者: alltheplaces 项目源码 文件源码
def spider_closed(spider):
        spider_stats[spider.name] = {
            'finish_reason': spider.crawler.stats.get_value('finish_reason'),
            'duration': (
                spider.crawler.stats.get_value('finish_time') -
                spider.crawler.stats.get_value('start_time')).total_seconds(),
            'item_scraped_count':
                spider.crawler.stats.get_value('item_scraped_count'),
        }

        print("Spider %s closed (%s) after %0.1f sec, %d items" % (
            spider.name,
            spider.crawler.stats.get_value('finish_reason'),
            (spider.crawler.stats.get_value('finish_time') -
                spider.crawler.stats.get_value('start_time')).total_seconds(),
            spider.crawler.stats.get_value('item_scraped_count') or 0,
        ))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号