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.12.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef824ef588c35895b1b5cbb6579ac5490a8cbc84c29b5f01bbb662e8144957b8 |
|
MD5 | 154cfdb3aec44d4664473732dfe02b52 |
|
BLAKE2b-256 | 071b0fe3b18b3a70507f5519b10b6d4c19a386ef5876ba01231e0d4a278f4b7c |
Close
Hashes for requests_random_user_agent-0.0.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee09f7165c1abacc479ec15a60468ef0de0b501555ed15ca0b5f7b271e35f5ef |
|
MD5 | caa715b8f30df13df4cb58ea4187893a |
|
BLAKE2b-256 | 365ca4b7a8b349fd318312da0303769b057c806d887555973f151f940cbbef04 |