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.9.21.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ae7c2acfbd94f603666caf966adb8663bb0349538a11c8ea538ebd9bed6c25f |
|
MD5 | dcc307c754ef05489301ed66d3a1ddc9 |
|
BLAKE2b-256 | 5ac37fda4330a5c1d3fb5fd75c8a7f534b08e450520c33e20e8ff010129e8e9e |
Close
Hashes for requests_random_user_agent-2020.9.21-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0181273e690f8bd426b4a752db29682d8d9549146320dd17deca7ae222d99d2 |
|
MD5 | 2b55d5caac662218577e489d992c1b63 |
|
BLAKE2b-256 | fe2b97d9aaedb155624f230058f618ddbbe28f9dc1cef2733eb9eacfdbe83f42 |