Automatically generate a random User Agent for the requests library
Project description
requests-random-user-agent
Configures the requests library to randomly select a desktop User-Agent. See the full list in requests_random_user_agent/useragents.txt.
Installation
pip install requests-random-user-agent
Usage
import requests
import requests_random_user_agent
s = requests.Session()
print(s.headers['User-Agent'])
# Without a session
resp = requests.get('https://httpbin.org/user-agent')
print(resp.json()['user-agent'])
User-Agents are randomized per-session or per-request. Individual HTTP requests without a session will each have a random User-Agent selected from the list in useragents.txt.
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
Built Distribution
Close
Hashes for requests_random_user_agent-2020.11.22.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52cb58c2c75a6e17a004e8026ac96d497c9843d240707ad80d34a3341b48f992 |
|
MD5 | 908459ed9ea568d94879d49530017a83 |
|
BLAKE2b-256 | 236f18d21e71d383ad22d2194d45c79bfb7c3bbc977b3d74a2fece53be4f1987 |
Close
Hashes for requests_random_user_agent-2020.11.22-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8f0f6bf6c25362e4f4c1a1a26e49a0db97819d5f49cccd5441b4065e22b4b27 |
|
MD5 | eae4145821edc78536a471bb813c0943 |
|
BLAKE2b-256 | 70d149d884757ce38290da85de2574a9e502b883192705aee6ca80627384437d |