Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async def parse(self, response):
"""
Used for subclasses, directly parse the responses corresponding with start_urls
:param response: Response
:return:
"""
raise NotImplementedParseError("")
async def parse(self, response):
"""
Used for subclasses, directly parse the responses corresponding with start_urls
:param response: Response
:return:
"""
raise NotImplementedParseError('')
async def handle_request(
self, request: Request
) -> typing.Tuple[AsyncGeneratorType, Response]:
"""
Wrap request with middleware.
:param request:
:return:
"""
callback_result, response = None, None
await self._run_request_middleware(request)
try:
callback_result, response = await request.fetch_callback(self.sem)
except NotImplementedParseError as e:
self.logger.error(e)
except NothingMatchedError as e:
self.logger.error(f"")
except Exception as e:
self.logger.error(f"
async def handle_request(self, request: Request) -> typing.Tuple[AsyncGeneratorType, Response]:
"""
Wrap request with middleware.
:param request:
:return:
"""
callback_result, response = None, None
await self._run_request_middleware(request)
try:
callback_result, response = await request.fetch_callback(self.sem)
except NotImplementedParseError as e:
self.logger.error(e)
except NothingMatchedError as e:
self.logger.error(f'')
except Exception as e:
self.logger.error(f'