Skip to main content

Automatically generate a random User Agent for the requests library

Project description

requests-random-user-agent Build Status PyPI

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

requests_random_user_agent-0.0.12.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

requests_random_user_agent-0.0.12-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file requests_random_user_agent-0.0.12.tar.gz.

File metadata

  • Download URL: requests_random_user_agent-0.0.12.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.4.8

File hashes

Hashes for requests_random_user_agent-0.0.12.tar.gz
Algorithm Hash digest
SHA256 ef824ef588c35895b1b5cbb6579ac5490a8cbc84c29b5f01bbb662e8144957b8
MD5 154cfdb3aec44d4664473732dfe02b52
BLAKE2b-256 071b0fe3b18b3a70507f5519b10b6d4c19a386ef5876ba01231e0d4a278f4b7c

See more details on using hashes here.

File details

Details for the file requests_random_user_agent-0.0.12-py3-none-any.whl.

File metadata

  • Download URL: requests_random_user_agent-0.0.12-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.4.8

File hashes

Hashes for requests_random_user_agent-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 ee09f7165c1abacc479ec15a60468ef0de0b501555ed15ca0b5f7b271e35f5ef
MD5 caa715b8f30df13df4cb58ea4187893a
BLAKE2b-256 365ca4b7a8b349fd318312da0303769b057c806d887555973f151f940cbbef04

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page