Pythonscrapy中怎么統(tǒng)計(jì)parse函數(shù)的執(zhí)行次數(shù)?
在spider類里面加個(gè)計(jì)數(shù)變量啊,然后再closed() 方法里面添加log,把計(jì)數(shù)給打印出來class MySpider(scrapy.Spider):def __init__(self):self.count = 0def parse(self, response):self.count += 1def closed(self):log(self.count)