HTTP Referer
field is set up by HTTP client in request headers, not in response headers, as this header tells server where did client come from to current page.
It would be rather weird to receive http Referer
header in response.
But when talking about scrapy
, there's a reference to Request
object on which the Response
was generated, in response's request
field, so the next call result:
response.request.headers.get('Referer', None)
can contain Referer
header if it was set when making request.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…