(self, request, response, spider)
| 365 | return new_request |
| 366 | |
| 367 | def process_response(self, request, response, spider): |
| 368 | if not request.meta.get("_splash_processed"): |
| 369 | return response |
| 370 | |
| 371 | splash_options = request.meta['splash'] |
| 372 | if not splash_options: |
| 373 | return response |
| 374 | |
| 375 | # update stats |
| 376 | endpoint = splash_options['endpoint'] |
| 377 | self.crawler.stats.inc_value( |
| 378 | 'splash/%s/response_count/%s' % (endpoint, response.status) |
| 379 | ) |
| 380 | |
| 381 | # handle save_args/load_args |
| 382 | self._process_x_splash_saved_arguments(request, response) |
| 383 | if get_splash_status(response) == 498: |
| 384 | logger.debug("Got HTTP 498 response for {}; " |
| 385 | "sending arguments again.".format(request), |
| 386 | extra={'spider': spider}) |
| 387 | return self._498_retry_request(request, response) |
| 388 | |
| 389 | if splash_options.get('dont_process_response', False): |
| 390 | return response |
| 391 | |
| 392 | response = self._change_response_class(request, response) |
| 393 | |
| 394 | if self.log_400 and get_splash_status(response) == 400: |
| 395 | self._log_400(request, response, spider) |
| 396 | |
| 397 | return response |
| 398 | |
| 399 | def _change_response_class(self, request, response): |
| 400 | from scrapy_splash import SplashResponse, SplashTextResponse |
nothing calls this directly
no test coverage detected