Python requests - saving a cookie for future use of the URL

I tried to get the cookie and publish it on the URL that will be used later in the program, but I cannot get the cookie settings to work.

I have now

response = requests.get("url")

But how exactly do I extract cookies from this URL and send them to the new URL (the same cookies). The tutorial in the queries is somewhat vague on the topic and gives examples that I cannot verify. Hope someone can help with further examples.

This is python 2.7 bit.

+5
source share
1 answer

Do you want to use session :

s = requests.session()

response = s.get('url')

, requests ( ), cookie .

+15

All Articles