MCPcopy
hub / github.com/scrapy/scrapy / get_meta_refresh

Function get_meta_refresh

scrapy/utils/response.py:43–53  ·  view source on GitHub ↗

Parse the http-equiv refresh parameter from the given response

(
    response: TextResponse,
    ignore_tags: Iterable[str] = ("script", "noscript"),
)

Source from the content-addressed store, hash-verified

41
42
43def get_meta_refresh(
44 response: TextResponse,
45 ignore_tags: Iterable[str] = ("script", "noscript"),
46) -> tuple[None, None] | tuple[float, str]:
47 """Parse the http-equiv refresh parameter from the given response"""
48 if response not in _metaref_cache:
49 text = response.text[0:4096]
50 _metaref_cache[response] = html.get_meta_refresh(
51 text, get_base_url(response), response.encoding, ignore_tags=ignore_tags
52 )
53 return _metaref_cache[response]
54
55
56def response_status_message(status: bytes | float | str) -> str:

Callers 2

process_responseMethod · 0.90
test_get_meta_refreshFunction · 0.90

Calls 1

get_base_urlFunction · 0.85

Tested by 1

test_get_meta_refreshFunction · 0.72