scrapy authentication login with cookies scrapy authentication login with cookies selenium selenium

scrapy authentication login with cookies


Your question is more of debug issue, so my answer will have just some notes on your question, not the exact answer.

def parse(self, response,my_cookies=get_cookies):    return Request(url="http://my_domain.com/",        cookies=my_cookies,        callback=self.login)

my_cookies=get_cookies - you are assigning a function here, not the result it returns. I think you don't need to pass any function here as parameter at all. It should be:

def parse(self, response):    return Request(url="http://my_domain.com/",        cookies=self.get_cookies(),        callback=self.login)

cookies argument for Request should be a dict - please verify it is indeed a dict.

I cant really even tell if anything is working or not.

Put some prints in the callbacks to follow the execution.