networksnsa.blogg.se

Ms agent 2.0
Ms agent 2.0












ms agent 2.0

is_touch_capable # returns False user_agent.

  • is_bot: whether user agent is a search engine crawler/spiderįor example: from user_agents import parse # Let's start from an old, non touch Blackberry device ua_string = 'BlackBerry9700/5.0.0.862 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/331 UNTRUSTED/1.0 3gpp-gba' user_agent = parse ( ua_string ) user_agent.
  • is_touch_capable: whether user agent has touch capabilities.
  • ms agent 2.0 ms agent 2.0

    is_pc: whether user agent is identified to be running a traditional "desktop" OS (Windows, OS X, Linux).is_tablet: whether user agent is identified as a tablet device (iPad, Kindle Fire, Nexus 7 etc).is_mobile: whether user agent is identified as a mobile phone (iPhone, Android phones, Blackberry, Windows Phone devices etc).As for now, these attributes should correctly identify popular platforms/devices, pull requests to support smaller ones are always welcome.Ĭurrently these attributes are supported: User_agents also expose a few other more "sophisticated" attributes that are derived from one or more basic attributes defined above. model # returns 'iPhone' # Viewing a pretty string version str ( user_agent ) # returns "iPhone / iOS 5.1 / Mobile Safari 5.1"

    ms agent 2.0

    device # returns Device(family=u'iPhone', brand=u'Apple', model=u'iPhone') user_agent. version_string # returns '5.1' # Accessing user agent's device properties user_agent. os # returns OperatingSystem(family=u'iOS', version=(5, 1), version_string='5.1') user_agent. version_string # returns '5.1' # Accessing user agent's operating system properties user_agent. family # returns 'Mobile Safari' user_agent. browser # returns Browser(family=u'Mobile Safari', version=(5, 1), version_string='5.1') user_agent. For example: from user_agents import parse # iPhone's user agent string ua_string = 'Mozilla/5.0 (iPhone CPU iPhone OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B179 Safari/7534.48.3' user_agent = parse ( ua_string ) # Accessing user agent's browser attributes user_agent. Various basic information that can help you identify visitors can be accessed browser, device and os attributes. User-agents is hosted on PyPI and can be installed as such: pip install pyyaml ua-parser user-agentsĪlternatively, you can also get the latest source code from Github and install it manually. User_agents relies on the excellent ua-parser to do the actual parsing of the raw user agent string.

  • User agent has touch capabilities (has touch screen).
  • User agent is a mobile, tablet or PC based device.
  • User_agents is a Python library that provides an easy way to identify/detect devices like mobile phones, tablets and their capabilities by parsing (browser/HTTP) user agent strings.














    Ms agent 2.0