✏d
Size: a a a
✏d
A
A
MМ
def process_spider_exception(self, response, exception, spider):То что yieldит мидлварь запускается или просто игнорирует?
# Called when a spider or process_spider_input() method
# (from other spider middleware) raises an exception.
# Should return either None or an iterable of Request or item objects.
if exception == IpBannedException:
with Controller.from_port(port = 9051) as controller:
controller.authenticate()
controller.signal(Signal.NEWNYM)
logging.warning("IP rotated")
new_request = response.request.replace(dont_filter=True)
logging.warning("retry request")
yield new_request
raise exceptions.IgnoreRequest
AR
AR
A
AR
AR
A
AR
A