Вот совершенно не пойму, почему я не могу получить ‘remixq_*** куку’
По шагам повторяя браузер, я понял что нужно только remixsid, но вот как его получить, ума не приложу, уже 2й день бьюсь.
UA = 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/48.0' with requests.Session() as s: s.headers['User-Agent'] = UA r = s.get('https://vk.com/login') remixlhk = r.cookies._cookies['.vk.com']['/']['remixlhk'].value tree = html.fromstring(r.content) ip_h = tree.xpath("//form[@id='login_form']/input[@name='ip_h']")[0].value lg_h = tree.xpath("//form[@id='login_form']/input[@name='lg_h']")[0].value data_set = { 'act': 'login', 'role': 'al_frame', 'expire': '', 'captcha_sid': '', 'captcha_key': '', '_origin': 'https://vk.com', 'ip_h': ip_h, 'lg_h': lg_h, 'email': login, 'pass': password, } prepared_post = requests.Request('POST', "https://login.vk.com/?act=login", data=data_set, headers={ 'User-Agent': UA, 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Cookie': 'remixlhk=%s; remixlang=3; remixflash=0.0.0; remixscreen_depth=24; remixdt=0' % remixlhk, 'Referer': 'https://vk.com/login', 'Host': 'login.vk.com', 'Accept-Encoding': 'gzip, deflate, br', 'Accept-Language': 'en-US,en;q=0.5', 'Connection': 'keep-alive', 'Upgrade-Insecure-Requests': '1' }) prepared_post = prepared_post.prepare() del prepared_post.headers['Content-Length'] del prepared_post.headers['Content-Type'] response = s.send(prepared_post, allow_redirects=False) # post = s.post("https://login.vk.com/?act=login", data=data_set) # val_cookies = post.cookies print response.headers assert 'remixq_' in response.headers.get('Set-Cookie') res = s.get('https://vk.com/kaldown') print 'Страница доступна только авторизованным пользователям' not in res.content
Помогите плиз
