kaivean / python-ua-device

user-agent parser for python , more accurate
20 stars 5 forks source link

version检查报错:ValueError: could not convert string to float: #10

Closed tcluzhe closed 3 weeks ago

tcluzhe commented 6 months ago

test.py

from uaDevice import parseUA
ua = 'BlackBerry7100i/4.1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/103'
parseUA(ua)

报错:

Traceback (most recent call last):
  File "test.py", line 4, in <module>
    parseUA(ua)
  File "./uaDevice/uaDevice.py", line 31, in parseUA
    uaData = UA(ua).getUaInfo()
  File "./uaDevice/useragentBase.py", line 90, in __init__
    self.detect(ua)
  File "./uaDevice/useragentBase.py", line 709, in detect
    ver = float('.'.join(ver.split('.')[:2])) # 只要一个dot,否则float报错
ValueError: could not convert string to float:
kaivean commented 3 weeks ago

@tcluzhe 你还需要解析黑莓吗?还是只是一个例子,我打算把一些基本没有用的设备、系统和浏览器的解析删掉了

tcluzhe commented 2 weeks ago

这是我们平台真实的访问记录 没事,你删吧,应该问题不大