You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ua_string ='Mozilla/5.0 (Linux; U; Android 4.0.4; en-gb; GT-I9300 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30'
84
-
user_agent =user_agents.parse(ua_string)
85
+
user_agent = parse(ua_string)
85
86
user_agent.is_mobile # returns True
86
87
user_agent.is_tablet # returns False
87
88
user_agent.is_touch_capable # returns True
88
89
user_agent.is_pc # returns False
89
90
90
91
# iPad's user agent string
91
92
ua_string ='Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10'
92
-
user_agent =user_agents.parse(ua_string)
93
+
user_agent = parse(ua_string)
93
94
user_agent.is_mobile # returns False
94
95
user_agent.is_tablet # returns True
95
96
user_agent.is_touch_capable # returns True
96
97
user_agent.is_pc # returns False
97
98
98
99
# Kindle Fire's user agent string
99
100
ua_string ='Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-80) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=true'
100
-
user_agent =user_agents.parse(ua_string)
101
+
user_agent = parse(ua_string)
101
102
user_agent.is_mobile # returns False
102
103
user_agent.is_tablet # returns True
103
104
user_agent.is_touch_capable # returns True
104
105
user_agent.is_pc # returns False
105
106
106
107
# Touch capable Windows 8 device
107
108
ua_string ='Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0; Touch)'
0 commit comments