MCPcopy
hub / github.com/scrapy/scrapy / inspect_response

Function inspect_response

scrapy/shell.py:310–320  ·  view source on GitHub ↗

Open a shell to inspect the given response

(response: Response, spider: Spider)

Source from the content-addressed store, hash-verified

308
309
310def inspect_response(response: Response, spider: Spider) -> None:
311 """Open a shell to inspect the given response"""
312 # Shell.start removes the SIGINT handler, so save it and re-add it after
313 # the shell has closed
314 sigint_handler = signal.getsignal(signal.SIGINT)
315 if not spider.crawler.settings.getbool("TWISTED_REACTOR_ENABLED"):
316 loop = asyncio.get_running_loop()
317 else:
318 loop = None
319 Shell(spider.crawler, loop=loop).start(response=response, spider=spider)
320 signal.signal(signal.SIGINT, sigint_handler)
321
322
323def _request_deferred(request: Request) -> Deferred[Any]:

Callers

nothing calls this directly

Calls 3

ShellClass · 0.85
getboolMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected