class documentation

class RefererMiddleware:

View In Hierarchy

Undocumented

Class Method from​_crawler Undocumented
Method __init__ Undocumented
Method policy Determine Referrer-Policy to use from a parent Response (or URL), and a Request to be sent.
Method process​_spider​_output Undocumented
Method request​_scheduled Undocumented
Instance Variable default​_policy Undocumented
@classmethod
def from_crawler(cls, crawler):

Undocumented

def __init__(self, settings=None):

Undocumented

def policy(self, resp_or_url, request):

Determine Referrer-Policy to use from a parent Response (or URL), and a Request to be sent.

  • if a valid policy is set in Request meta, it is used.
  • if the policy is set in meta but is wrong (e.g. a typo error), the policy from settings is used
  • if the policy is not set in Request meta, but there is a Referrer-policy header in the parent response, it is used if valid
  • otherwise, the policy from settings is used.
def process_spider_output(self, response, result, spider):

Undocumented

def request_scheduled(self, request, spider):

Undocumented

default_policy =

Undocumented