Scrapy 1.0 - Log Settings

1

I need to know how I can do to change the highlighted fields, because when I run my program with Scrapy in version 1.0 it printed the result in these highlighted quantities.

I wanted to know how to change them, whether it's through a script or the Scrapy settings or even Spiders.

    
asked by anonymous 29.03.2016 / 15:10

1 answer

1

To change the statistics values generated during spider execution, you must use the "Stats Collection" interface. Manual: link

Examples:

  • Change a value:

    stats.set_value('hostname', socket.gethostname())

  • Increase:

    stats.inc_value('pages_crawled')

  • The 'stats' object is a field of the 'crawler' object.

    crawler.stats.get_value('start_time')
    
        
    02.04.2016 / 10:03