shon / httpagentparser

Python HTTP Agent Parser
http://pypi.python.org/pypi/httpagentparser/
MIT License
222 stars 55 forks source link

Android version is invalid when user agent contains no device name after OS version #82

Closed vpolikarpov closed 5 years ago

vpolikarpov commented 5 years ago

User agent:

Mozilla/5.0 (Linux; Android 8.1.0) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.111 Mobile Safari/537.36

Parsed:

{
  'platform': {
    'name': 'Android', 
    'version': '8.1.0) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.111 Mobile Safari/537.36'
  }, 
  'os': {
    'name': 'Linux'
  }, 
  'bot': False, 
  'dist': {
    'name': 'Android', 
    'version': '8.1.0) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.111 Mobile Safari/537.36'
  }, 
  'browser': {
    'name': 'Chrome', 
    'version': '76.0.3809.111'
  }
}