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.17.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03691f2bf7b36c135a336421145102ba0c5fb44b02a6360fa40f0e65c3acb17a |
|
MD5 | 670462825b16bbc64b00716863589353 |
|
BLAKE2b-256 | 9c0e5c68e262433f5d2ad78cbb5623cad5062b43adbeb63d9632a98359d703ee |
Close
Hashes for requests_random_user_agent-0.0.17-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 172eb737037f7479873fb0c3edbb02b1667041d5ce87ae3db62ae39fc778b195 |
|
MD5 | 328e4aa6b7ce430daa3f8c7b214150e2 |
|
BLAKE2b-256 | 75cc5c18ff14b92bb1e1ac8993a9d6d8824a9396c61e4e04802b5c3736f3c01e |