Skip to main content

A package to get random user agents based filters provided by user

Project description

Random User Agents

Random User Agents is a python library that provides list of user agents, from a collection of more than 326,000+ user agents, based on filters.

Some of the filter names which can be passed to UserAgent() are listed below:

operating_systems : [
    UNIX, LINUX, WINDOWS, MAC, ...
]

hardware_types : [
    MOBILE, COMPUTER, SERVER, ...
]

software_types : [
    WEB_BROWSER, BOT__CRAWLER, BOT__ANALYSER, ...
]

software_names : [
   EDGE, CHROME, CHROMIUM, ANDROID, FIREFOX, OPERA, ...
]

software_engines : [
   BLINK, GECKO, WEBKIT, ...
]

popularity : [
    MOST_POPULAR, POPULAR, AVERAGE, ....
]

All filters are available in random_user_agent.params

Installation

You can install random_useragent by running the following command:

pip install random_user_agent

Or you can download direct from Github and install it manually.

Usage

To get 100 user agents of browser chrome based on operating systems windows or linux

    from random_user_agent.user_agent import UserAgent
    from random_user_agent.params import SoftwareName, OperatingSystem


    # you can also import SoftwareEngine, HardwareType, SoftwareType, Popularity from random_user_agent.params
    # you can also set number of user agents required by providing `limit` as parameter

    software_names = [SoftwareName.CHROME.value]
    operating_systems = [OperatingSystem.WINDOWS.value, OperatingSystem.LINUX.value]   

    user_agent_rotator = UserAgent(software_names=software_names, operating_systems=operating_systems, limit=100)

    # Get list of user agents.
    user_agents = user_agent_rotator.get_user_agents()

    # Get Random User Agent String.
    user_agent = user_agent_rotator.get_random_user_agent()

License

The MIT License (MIT). Please see License File for more information.

User Agents Source

special thanks to whatismybrowser for providing real user agents.

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

random_user_agent-1.0.0.tar.gz (8.2 MB view details)

Uploaded Source

Built Distribution

random_user_agent-1.0.0-py3-none-any.whl (8.2 MB view details)

Uploaded Python 3

File details

Details for the file random_user_agent-1.0.0.tar.gz.

File metadata

  • Download URL: random_user_agent-1.0.0.tar.gz
  • Upload date:
  • Size: 8.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.6

File hashes

Hashes for random_user_agent-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f603af96e9af9ba1ddace1e86c017312955690d0f2cef9447d17cee6afdf75e8
MD5 7a0f5d55e73ecfa139d71a46fa51cfb3
BLAKE2b-256 303a4672fe4e510329acd23d9d6045d81062b43b1647f5ac3d52418a38b372fb

See more details on using hashes here.

File details

Details for the file random_user_agent-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: random_user_agent-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.6

File hashes

Hashes for random_user_agent-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1dd8cda469c11cf07317edc9d6cb7d8f73bfbe6a815e315c6d7dad4e953f74ec
MD5 592086086507caabe828740029e4b983
BLAKE2b-256 44ba6c81a2966e58e2229795ce68cc56d58002f391985d0721eb7372a23217f7

See more details on using hashes here.

Supported by

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