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.11.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | addc756165ff0e3775781f5e7afc10074fd743be4e03ddad3f646607dbf53ea6 |
|
MD5 | fb635c29aab962a502cf4cde6d7255ce |
|
BLAKE2b-256 | 0548a04fcb87b9c69d17a54681326d128966f131dc82df750c9eabf6261906e7 |
Close
Hashes for requests_random_user_agent-0.0.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4a0821ab42b6a084dab06f304083eb41c94d938071f3818e64ba8aaf8090723 |
|
MD5 | 6b7eda735807d04333c2c737469c947d |
|
BLAKE2b-256 | 4c7a64efa43232be840f08432e4332e917e0a9e006b6ef7e435e62df888414ea |