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-0.0.10.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 017d2a87251d8ad905c8c26d39e7eb2b92fcd800fea3368595f8a87eaaae2f67 |
|
MD5 | 7a62eb0440ac765dae8f8089d5743607 |
|
BLAKE2b-256 | ef1baac0867626b0052cd61f0e1f64c003e9bf3a1fa5aa4e9dba6be3db35e421 |
Close
Hashes for requests_random_user_agent-0.0.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f4bf0f75514363afd161de0a6448d085b0711d2d115ef61d582974f674b68c0 |
|
MD5 | 90a550b9d38e1d60ee05a7b976b0c299 |
|
BLAKE2b-256 | 28a4aeb90335d4beb1a09d502570070d32da0b2beb86c349e31238ff34fe5a08 |