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.
Android User-Agents
Set the environment variable UA_PLATFORM=android to use a list of Android-specific User-Agents instead. List provided by WhatIsMyBrowser.
Metadata
Release files for requests-random-user-agent 2023.10.25
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| requests_random_user_agent-2023.10.25.tar.gz | 45.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| requests_random_user_agent-2023.10.25-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 93.0 kB
Release files / requests_random_user_agent-2023.10.25.tar.gz
| Download URL | requests_random_user_agent-2023.10.25.tar.gz |
|---|---|
| Size | 45.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ecc95f95b8da16ef38ed479f9faa21b9bfbd49ebea55d8c0ad042e0b64b74d26
|
|
BLAKE2b-256 checksum How to use checksums |
d406313161c85c087b95c4ce357dddaf065076eaf2463b06320a2ef47bc5b6c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.9.21
|
Release files / requests_random_user_agent-2023.10.25-py3-none-any.whl
| Download URL | requests_random_user_agent-2023.10.25-py3-none-any.whl |
|---|---|
| Size | 47.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f4f4f7c23c317e3a8d5485c56e9e4000fe4dd2bfec308f151a6ff7a32189a99c
|
|
BLAKE2b-256 checksum How to use checksums |
08cb91555e856333e19e0ace665245642f90c4112ea471eb81523784d2032105
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.9.21
|