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.16.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05daab20e1754f3835ed7295899bb022876627beda7ee1b0179d23b5ca0fd867 |
|
MD5 | 41d811c57534d58ca1474211e77035ce |
|
BLAKE2b-256 | 4854a64556ad13a3139f6107fda94a9d8d8e7c03dda370da027f1e3364e9d005 |
Close
Hashes for requests_random_user_agent-0.0.16-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2049d26ecd52b69b63dba8ff5ce68097a351c969662fc6f6024f0f0711ba65d |
|
MD5 | f9279481b01d846303b81f589792c486 |
|
BLAKE2b-256 | 7fe75046976e7431ed9ca60dcecf5974ba1bf8da17f105796209159e5eb60c15 |