fix process exception

This commit is contained in:
cooper 2024-06-18 22:28:06 +08:00
parent adf61f2a9e
commit 3fae0091b3

View File

@ -44,6 +44,7 @@ class ProxyMiddleware:
def process_exception(self, request, exception, spider): def process_exception(self, request, exception, spider):
# 处理发生异常的请求 # 处理发生异常的请求
self._handle_proxy_failure(request.meta['proxy'], spider) self._handle_proxy_failure(request.meta['proxy'], spider)
spider.info(f"Changing proxy to {request.meta['proxy']} due to exception: {exception}")
# 重新调度请求 # 重新调度请求
return request return request