Randomizes the user agent, along with default headers found with that browser as well as the cipher suite used.
Project description
Python Requests – Anonymous Session
Randomizes the user agent, and applies the default headers and cipher suite found in that browser.
Installation
pip install python-requests-anonymous-session
Usage
Note: AnonymousSession
inherits from requests.Session
.
Simple
from python_requests_anonymous_session import AnonymousSession
session = AnonymousSession()
Advanced
Choose wether you want to use mobile/desktop broswer profiles
session = AnonymousSession(browser={
'desktop': False, # default True,
'mobile': True, # default True,
})
Slightly More Advanced
Choose which user-agent
you want. If the user-agent
is in found in our database the correct default headers
and cipher suite will be applied.
session = AnonymousSession(browser={
'custom': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148',
})
Credits
- VeNoMouS/cloudscraper for the browsers.json
file and the original
UserAgent
andCipherSuiteAdapter
implementations.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file python-requests-anonymous-session-1.0.2.tar.gz
.
File metadata
- Download URL: python-requests-anonymous-session-1.0.2.tar.gz
- Upload date:
- Size: 83.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a3f22e25c4736623bce63f1b9f8764e7c8dfb1f9e942027ba6953b22333afb2 |
|
MD5 | c8caca4625df79f3cf4721df4b074a00 |
|
BLAKE2b-256 | 33438e1956fd291b4101cd513d17c12ed4876b7747be7f2547d03080fc3a01a5 |