def from_crawler(cls, crawler) -> 'RequestLogMiddleware':
log_path = crawler.settings.get('RESPONSE_LOG_FILE')
if not log_path:
raise NotConfigured('RESPONSE_LOG_FILE not defined')
jl_logger = get_jl_logger(log_path)
threshold = crawler.settings.getfloat('PAGE_RELEVANCY_THRESHOLD', 0.5)
return cls(jl_logger=jl_logger, relevancy_threshold=threshold)
评论列表
文章目录