Quantcast
Channel: CodeSection,代码区,Python开发技术文章_教程 - CodeSec
Viewing all articles
Browse latest Browse all 9596

n8henrie/pycookiecheat: Borrow cookies from your browser's authenticated session ...

$
0
0
pycookiecheat

Borrow cookies from your browser's authenticated session for use in python scripts.

Free software: MIT Documentation: http://n8h.me/HufI1w Installation

NB:Use pip and python instead of pip3 and python3 if you're still on Python 2.

Quickstart pip3 install pycookiecheat Development Setup git clone https://github.com/n8henrie/pycookiecheat.git cd pycookiecheat python3 -m venv venv venv/bin/pip install -e .[dev] Usage from pycookiecheat import chrome_cookies import requests url = 'http://example.com/fake.html' # Uses Chrome's default cookies filepath by default cookies = chrome_cookies(url) 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')

Features Returns decrypted cookies from Google Chrome on OSX or linux. FAQ / Troubleshooting How about windows?

I don't use Windows or have a PC, so I won't be adding support myself. Feel free to make a PR :)

I get an installation error with the cryptography module on OS X

If you're gettingthis error and using Homebrew, then you need to follow the instructions for Building cryptography on OS X and export LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" and try again.


Viewing all articles
Browse latest Browse all 9596

Trending Articles