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.5.24.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d33310e37f9fcf56299a5191d50f6bb753c252f9a7c59a50c17281f0402bc92 |
|
MD5 | ef853a44a428347f92fc111faa2a3c71 |
|
BLAKE2b-256 | 6068a9a28763c4e3b0dd8bb393e1af79687071724316795dc78d2da833a93215 |
Close
Hashes for requests_random_user_agent-2020.5.24-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9badd2a87a6d66b4bcb4257b169a4cabb66e2f9999e9da741ad049e490d3f59 |
|
MD5 | e6cb2584fa261ac621e265d341e52c68 |
|
BLAKE2b-256 | 855185888f73f4f98f5b32ce810a1497f95aa95c82c0e747d6240bd5ab9bc01c |