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.18.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b3fd4de008f91f3a02ca1cd921c66b2e4e39617dc33be51ba8ea355ebe8eda6 |
|
MD5 | 3ae1e879e3d7f11732cf8d89f60013d1 |
|
BLAKE2b-256 | 3a8546dd5adc8ad420e30d541d3d42896b678d74751343c914ac2f1c86faeb29 |
Close
Hashes for requests_random_user_agent-0.0.18-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b6706afe328414659792540f1c44f00c271711779868f6285a9545eed26ec3f |
|
MD5 | 484a5c4a1494cfb2136408eacd4c6f71 |
|
BLAKE2b-256 | a1f86895324f806ecf9ffe794aafb2d9077e36441b58f873c9389ca6f677c4a0 |