Cookies must be enabled in your browser [Python Requests]

前端 未结 1 1665
遥遥无期
遥遥无期 2021-01-13 09:19

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://log         


        
相关标签:
1条回答
  • 2021-01-13 09:50

    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)
    
    0 讨论(0)
提交回复
热议问题