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.15.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9b102a15c534bc972c0d6957601c1f2ff34470dc3e0e03f88729fd22a3ab1bd |
|
MD5 | 58835dd085b16a746b369e0d386b3e57 |
|
BLAKE2b-256 | 256cf7e03a1b86d242f6536a4d048e4343d966f65da382949a9cf6466932aa61 |
Close
Hashes for requests_random_user_agent-0.0.15-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5491b0b7a5e55f478f5ef20c2ee9f3c5f238f7ae75bba5d68ffaaf8db63f36bf |
|
MD5 | a3dc3530f697196ab1cbad9bda5f0e7e |
|
BLAKE2b-256 | 63a1ed32c574e7d355f382cf685daec4f0b82630c513202c21a68209a48c3fa9 |