Logging in Scrapy

后端 未结 3 1133
半阙折子戏
半阙折子戏 2021-01-02 07:53

I am having trouble with logging in scrapy, and most of what I can find is out of date.

I have set LOG_FILE=\"log.txt\" in the settings.py

3条回答
  •  借酒劲吻你
    2021-01-02 08:09

    It seems that you're not calling your parse_page method at any time. Try to commenting your parse method and you're going to receive a NotImplementedError because you're starting it and you're saying it 'do nothing'.

    Maybe if you implement your parse_page method it'll work

    def parse(self, response):
        self.logger.info('Parse function called on %s', response.url)
        self.parse_page(response)
    

    Hope it helps you.

提交回复
热议问题