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
Asked
Active
Viewed 304 times
0
-
If you are using requests module, r = requests.get(url, cookies=cookies) – ksholla20 Apr 17 '19 at 03:34
1 Answers
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