Cookies must be enabled in your browser [Python Requests]
20,198
Use requests.Session
to persist a session (with cookies included):
import requests
s = requests.Session()
res = s.get('https://login.live.com')
cookies = dict(res.cookies)
res = s.post('https://login.live.com',
auth=('Email', 'Password'),
verify=False,
cookies=cookies)
Author by
k9b
Updated on July 09, 2022Comments
-
k9b almost 2 years
So I'm trying to log into my hotmail account via python and keep getting this response on the page when I make this request
r = requests.post('https://login.live.com', auth=('Email', 'Pass'),verify=False) Cookies must be allowed Your browser is currently set to block cookies. Your browser must allow cookies before you can use a Microsoft account. Cookies are small text files stored on your computer that tell Microsoft sites and services when you're signed in. To learn how to allow cookies, see online help in your web browser.
I would also like to mention that I am trying to httpPOST to this webpage because I would rather handle the cookies in the response and access other pages of my microsoft profile (rather than just accessing my email via the smtp server)
Thanks!
Edit :
import requests s = requests.Session() r = s.get('https://login.live.com',verify=False) r = s.post('https://login.live.com', auth=('user', 'pass'),verify=False) print r.status_code print r.text