Borrow cookies from your browser's authenticated session for use in Python scripts.
- Free software: GPLv3
- Documentation: http://n8h.me/HufI1w
pip3 install pycookiecheat
git clone https://github.com/n8henrie/pycookiecheat.git
cd pycookiecheat
python3 setup.py install
from pycookiecheat import chrome_cookies
import requests
url = 'http://example.com/fake.html'
cookies = chrome_cookies(url) ## Platform's default filepath.
r = requests.get(url, cookies=cookies)
Use the cookie_file
keyword-argument to specify a different filepath for the
cookies-file: chrome_cookies(url, cookie_file=/abspath/to/cookies)
- Returns decrypted cookies from Google Chrome on OSX or Linux.
I don't use Windows or have a PC, so I won't be adding support myself. Feel free to make a PR :)