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.10.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a699f1c91ff499b960e7e34d46b3170b3547c59e317dee802e24463db8636c4f |
|
MD5 | bec635aaa6910a0443b52c45aecc57fa |
|
BLAKE2b-256 | 059fb3bb9b53e1c322523e53bcc67724b0ae33612677e9d067625079915caf62 |
Close
Hashes for requests_random_user_agent-2020.10.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72322349d1f429a27671e2091e995204a94dc551384d44214fe813024cc382a1 |
|
MD5 | 6a1dd5754d9668458af01e6b3865f94f |
|
BLAKE2b-256 | 52819c53417d5b77ecc036126b673e78cf02938b156ef01dd3c575a8d3157dcf |