Skip to main content

User Agent Generator

A simple library to generate fake user agents for various platforms and browsers. This library can be useful for web scraping, testing, and simulating user behavior in web applications.

Features

  • Generates random user agents for multiple platforms:
    • Chrome
    • Firefox
    • Safari
    • Microsoft Edge
    • Internet Explorer
    • Android
    • iOS
    • Linux
    • Mac
    • Windows
  • Customizable version and build numbers
  • Easy to use and integrate into your projects

Installation

You can install the package using pip:

pip install useragent-generator

Usage

Here’s how to use the UserAgentGenerator class in your project:

Example

from spoofagent import UserAgentGenerator

# Create an instance of the generator
generator = UserAgentGenerator()

# Generate user agents for different platforms
chrome_ua = generator.generate_user_agent('chrome')
firefox_ua = generator.generate_user_agent('firefox')
safari_ua = generator.generate_user_agent('safari')
edge_ua = generator.generate_user_agent('edge')
ie_ua = generator.generate_user_agent('ie')
android_ua = generator.generate_user_agent('android')
ios_ua = generator.generate_user_agent('ios')
linux_ua = generator.generate_user_agent('linux')
mac_ua = generator.generate_user_agent('mac')
windows_ua = generator.generate_user_agent('windows')

# Print the generated user agents
print("Chrome User Agent:", chrome_ua)
print("Firefox User Agent:", firefox_ua)
print("Safari User Agent:", safari_ua)
print("Edge User Agent:", edge_ua)
print("Internet Explorer User Agent:", ie_ua)
print("Android User Agent:", android_ua)
print("iOS User Agent:", ios_ua)
print("Linux User Agent:", linux_ua)
print("Mac User Agent:", mac_ua)
print("Windows User Agent:", windows_ua)

Customizing User Agents

You can customize the version and build numbers when generating user agents:

custom_ua = generator.generate_user_agent('chrome', version='89', build='1234')
print("Custom Chrome User Agent:", custom_ua)

Platform Options

The following platforms are supported:

  • chrome
  • firefox
  • safari
  • edge
  • ie
  • android
  • ios
  • linux
  • mac
  • windows

Metadata

Release files for spoofagent 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spoofagent 1.0.1
File Size Uploaded
spoofagent-1.0.1.tar.gz 3.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spoofagent 1.0.1
File Interpreter ABI Platform
spoofagent-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 7.7 kB

Release files / spoofagent-1.0.1.tar.gz

Download URL spoofagent-1.0.1.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6c8f6390e369b4686bf75babc9f9adbf50c96630a7ad126c5d5b915c968764f0
BLAKE2b-256 checksum
How to use checksums
4ec9dcdc849b609597ff8cca8c34cc0b4b245245c3ec9f626d75dabf9062c140
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.8.10

Release files / spoofagent-1.0.1-py3-none-any.whl

Download URL spoofagent-1.0.1-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
35a49187a629251b7252c85d091a44fd9bdb7253a12ce8420e8f8b8a40a8997d
BLAKE2b-256 checksum
How to use checksums
91de6270917d4c3cebbad5754b8345ca07eee79da0cb6cc12719690a8bab34ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.8.10

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page