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-2020.11.11.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3fd753d330330db7b24dae367f954b0b83085fec45e8f1128bc83036198681e |
|
MD5 | 7cbaf7c2a3b0db5884e50d8e6f8dbd43 |
|
BLAKE2b-256 | aa55c874e0186977b7037bfc13e8f0854cfd44d0c9c338e83268150aa5c3530b |
Close
Hashes for requests_random_user_agent-2020.11.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe753c2c8662f5b00f0b39c4ccd74b6872d42de11cfde2140c41e59f29d2456d |
|
MD5 | 0357214a5deb02980fc1f4404b3cabda |
|
BLAKE2b-256 | ae276d42d968c1d08b5d6e37d40f26fc9beb1df87754553086d80ffb3b214d3e |