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.9.17.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2251b6392cf57578502e51d9a8baea0789a8bb053690954310a1a4d06ad0def4 |
|
MD5 | f8cb29000b08a50b96a3059de5c59b53 |
|
BLAKE2b-256 | 0bb0c2c6fd0f54af9d76703897518fc3024abcfca08ad2c255db15a260f3b730 |
Close
Hashes for requests_random_user_agent-2020.9.17-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fed3ecaf15a8074a1948113f85d12843b5e9f9fc94fa8b23b0cc8c73d64226c7 |
|
MD5 | 2c82b63ea1650c9c5c31d29fc54f99e2 |
|
BLAKE2b-256 | f7d8c614693c3bbfa65cf17f469a00e37208ebabc64165f7e153bf329ee90249 |