scrapy
2025年8月8日小于 1 分钟
scrapy genspider mydomain mydomain.comlog
scrapy crawl myspider -s LOG_LEVEL=INFO -s LOG_FILE=scrapy.logself.log(message)等同于 self.logger.debug(message)
self.log(f"开始爬取 {stock_type['name']}", level=log.INFO)
中间件
- 如果想禁止内置的中间件,就必须在项目的SPIDER_MIDDLEWARES设置中定义该中间件,并将其值赋为None