0

I am trying to get some data from a webpage using python requests which needs to be logged in first.The login http request "response header" contains "set-cookie" parameters which is used for the next http request of the webpage. Could any tell me how to use the set-cookie for the consecutive GET request of the webpage

1 Answers1

0

Try this

session = requests.Session()
response = session.get('http://google.com')
print(session.cookies.get_dict())

Or without using sessions use

response = requests.get('http://google.com')
response.cookies
Arun Augustine
  • 1,690
  • 1
  • 13
  • 20