MCPcopy
hub / github.com/scrapy/scrapy / crawled

Method crawled

scrapy/logformatter.py:75–93  ·  view source on GitHub ↗

Logs a message when the crawler finds a webpage.

(
        self, request: Request, response: Response, spider: Spider
    )

Source from the content-addressed store, hash-verified

73 """
74
75 def crawled(
76 self, request: Request, response: Response, spider: Spider
77 ) -> LogFormatterResult:
78 """Logs a message when the crawler finds a webpage."""
79 request_flags = f" {request.flags!s}" if request.flags else ""
80 response_flags = f" {response.flags!s}" if response.flags else ""
81 return {
82 "level": logging.DEBUG,
83 "msg": CRAWLEDMSG,
84 "args": {
85 "status": response.status,
86 "request": request,
87 "request_flags": request_flags,
88 "referer": referer_str(request),
89 "response_flags": response_flags,
90 # backward compatibility with Scrapy logformatter below 1.4 version
91 "flags": response_flags,
92 },
93 }
94
95 def scraped(
96 self, item: Any, response: Response | Failure | None, spider: Spider

Callers 1

_downloadMethod · 0.45

Calls 1

referer_strFunction · 0.90

Tested by

no test coverage detected