User-Agent generator
Project description
What is user_agent module for?
This module is for generating random, valid web user agents: * content of “User-Agent” HTTP headers * content of window.navigator JavaScript object
Usage Example
>>> from user_agent import generate_user_agent, generate_navigator
>>> from pprint import pprint
>>> generate_user_agent()
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:40.0) Gecko/20100101 Firefox/40.0'
>>> generate_user_agent(platform=('mac', 'linux'))
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:36.0) Gecko/20100101 Firefox/36.0'
>>> pprint(generate_navigator())
{'app_code_name': 'Mozilla',
'app_name': 'Netscape',
'appversion': '5.0',
'name': 'firefox',
'os': 'linux',
'oscpu': 'Linux i686 on x86_64',
'platform': 'Linux i686 on x86_64',
'user_agent': 'Mozilla/5.0 (X11; Ubuntu; Linux i686 on x86_64; rv:41.0) Gecko/20100101 Firefox/41.0',
'version': '41.0'}
>>> pprint(generate_navigator_js())
{'appCodeName': 'Mozilla',
'appName': 'Netscape',
'appVersion': '38.0',
'platform': 'MacIntel',
'userAgent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Firefox/38.0'}
Installation
Use pip:
$ pip install -U user_agent
Documentation
Documentation is available at http://user-agent.readthedocs.org
Contribution
Use github to submit bug,fix or wish request: https://github.com/lorien/user_agent/issues
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
user_agent-0.1.3.tar.gz
(5.1 kB
view details)
File details
Details for the file user_agent-0.1.3.tar.gz
.
File metadata
- Download URL: user_agent-0.1.3.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15ef00b0b5da5418d69b468cac140f02d17724860bf05beafc1c3e7cd0a766b0 |
|
MD5 | 7bb246fdc9c51a074bd099b843a15dfc |
|
BLAKE2b-256 | b8ea640fb6b3cc30d72cbf7d88d034d67a7c4bcc0da19a7a2568a6008bfac9c5 |