I have disabled the Default Scrapy cookie option, so that i have to set it manually.
COOKIES_ENABLED = False
COOKIES_DEBUG = True
现在,我需要把作为同一地点答复而得到的价值 set。 我能够像以下那样获得厨师。
cookie = response.headers.getlist( Set-Cookie )[0].split(";")[0].split("=")
now i am trying to set it to the form request by
FormRequest.from_response(response,
formdata={"username": "asldkfs", "pass": "slskd"},
cookies={cookie[0]:cookie[1]},
meta = { dont_redirect : True, handle_httpstatus_list : [302]},
callback=self.redirection)
def redirection(self,response):
self.log("redirection")
self.log(response.headers)
self.log("Cookie2")
cook1 = response.headers.getlist( Set-Cookie )[0].split(";")[0].split("=")
self.log(cook1)
self.log("end cookie2")
return Request("http://something.net/some/sa/"+response.headers.getlist( Location )[0],cookies={cook1[0]:cook1[1]},
callback=self.check_login_response)
.
.
.
因此,我不能 set。 是否还需要确定任何其他价值或问题是什么?