Skip to content

Commit

Permalink
Update README to show enum usage
Browse files Browse the repository at this point in the history
  • Loading branch information
n8henrie committed Dec 29, 2023
1 parent 7fdc1b4 commit 03766fc
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,25 @@ Alternatively, some users have suggested running Chrome with the
## Usage

```python
from pycookiecheat import chrome_cookies
from pycookiecheat import BrowserType, chrome_cookies
import requests

url = 'http://example.com/fake.html'
url = 'https://n8henrie.com'

# Uses Chrome's default cookies filepath by default
cookies = chrome_cookies(url)
r = requests.get(url, cookies=cookies)

# Using an alternate browser
cookies = chrome_cookies(url, browser=BrowserType.CHROMIUM)
```

Use the `cookie_file` keyword-argument to specify a different filepath for the
cookies-file: `chrome_cookies(url, cookie_file='/abspath/to/cookies')`

Keep in mind that pycookiecheat defaults to looking for cookies for Google
Chrome, not Chromium, so if you're using the latter, you'll need to manually
specify something like `"/home/username/.config/chromium/Default/Cookies"` (for
Linux) as your `cookie_file`.
You may be able to retrieve cookies for alternative Chromium-based browsers by
manually specifying something like
`"/home/username/.config/BrowserName/Default/Cookies"` as your `cookie_file`.

## Features

Expand Down

0 comments on commit 03766fc

Please sign in to comment.