How to set a cookie using requests

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



How to set a cookie using requests



I am trying to set a cookie and there does not seem to be much out there on how to set the cookie after creating the cookie. This is what I have so far:


import requests
url = '--REDACTED--'
cookies = dict(cookies_are='working')
r = requests.get(url, cookies=cookies)
r.text



What now? When I visit the website, I do not see the cookie in my browser's cookie manager so this code alone is insufficient to set the cookie.



I've read about sending the cookie through a header, but have been unable to find any example code on how to do that.



Mostly been relying on these so far:
https://jayconrod.com/posts/17/how-to-use-http-cookies-in-python
http://docs.python-requests.org/en/latest/user/quickstart/#cookies









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard