Skip to main content

create a fake useragent

Project description

my-fake-useragent

generate your random fake useragent.

TODO

version_ranget filter

description:

create your fake useragent

install

python setup.py install

or

pip install my_fake_useragent

usage

from my_fake_useragent import UserAgent

ua = UserAgent(family='chrome')

res = ua.random()

family参数可用:

可以设置列表还匹配多种情况

  • chrome
  • firefox
  • edge
  • ie
  • opera
  • safari

os_family参数可用

可以设置列表还匹配多种情况

  • android
  • windows
  • linux
  • mac
  • ios
  • chrome os

phone参数可用

  • None 不过滤
  • True 要求是移动端
  • False 要求不是移动端

移动端的判据如下: 如果device family检测到:

[
    'BlackBerry',
    'BlackBerry 9700',
    'BlackBerry 9800',
    'Generic Feature Phone',
    'Generic Smartphone',
    'Generic Tablet',
    'HTC Desire',
    'HTC DesireHD A9191',
    'HTC DesireS S510e',
    'HTC DesireZ A7272',
    'HTC HD2_T8585',
    'HTC IncredibleS S710e',
    'HTC Legend',
    'HTC P715a',
    'HTC Pyramid',
    'HTC Sensation',
    'HTC Vision',
    'LG-L160L',
    'LG-LU3000',
    'LG-P505R',
    'Nintendo Wii',
    'Nokia 2730c-1',
    'SprintPPC-6700',
    'SprintPPC-6700)',
    'SprintPPC-i830',
    'SprintSCH-i320',
    'SprintSCH-i830',
    'SprintSPH-ip320',
    'SprintSPH-ip830w',
    'T-Mobile myTouch 3G Slide',
    'iPad',
    'iPhone',
    'iPod']

则认为是移动端,同时还补充 认为 android操作系统和ios操作系统也是移动端。

一个符合过滤例子如下:

要求 linux操作系统的的chrome 浏览器:

from my_fake_useragent import UserAgent
ua = UserAgent(family='chrome', os_family='linux')

CHANGELOG

0.1.6

nothing change on the source code, but add the pypi wheel to speed up installation.

0.1.1

this module does not need any third module at all.

0.1.0

init

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

my_fake_useragent-0.1.6.tar.gz (272.3 kB view details)

Uploaded Source

Built Distribution

my_fake_useragent-0.1.6-py3-none-any.whl (301.0 kB view details)

Uploaded Python 3

File details

Details for the file my_fake_useragent-0.1.6.tar.gz.

File metadata

  • Download URL: my_fake_useragent-0.1.6.tar.gz
  • Upload date:
  • Size: 272.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.0

File hashes

Hashes for my_fake_useragent-0.1.6.tar.gz
Algorithm Hash digest
SHA256 4eb6e0d76024addb089949db638935b897613eee273efa1a721db3f4f9cae2e8
MD5 005a9c679fa1676b9f760186a900827c
BLAKE2b-256 96f6529274a01f77c46d4f9e32e300abd3c75bdadc958a21f4aef62e7eb8ae3b

See more details on using hashes here.

File details

Details for the file my_fake_useragent-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: my_fake_useragent-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 301.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.0

File hashes

Hashes for my_fake_useragent-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 539d97a725f8df82dbaa9d03472911bc74ccb0091faa935d106d50fe70e1744e
MD5 a16de6216746ab7df92c1243f601d5f6
BLAKE2b-256 2b1f51574a79dc60587ecd822243b406a0f4e5c6f53a7a50141fca7ed222a748

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 Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page