Determine from a HTTP request if the user is on a Smart Phone, IE, Firefox

Vivek Shrivastava vivshrivastava at gmail.com
Tue Feb 1 01:51:18 CET 2011


>
> its userAgent or UserAgent String. Though its easy to send request with
> any( fake) userAgent but its industry standard to get browser information
> from userAgent only.
>
> http://www.useragentstring.com/pages/useragentstring.php
>
>
>
> On Mon, Jan 31, 2011 at 2:46 PM, James Mills <prologic at shortcircuit.net.au
> > wrote:
>
>> On Tue, Feb 1, 2011 at 8:16 AM, Sascha <samzielkeryner at gmail.com> wrote:
>> > I am returning specialised website html according to what platform the
>> > user is on. Is there a way to determine if the user is on a Smart
>> > Phone or on IE or on Firefox?
>>
>> I have an iPad and just wrote a simple demo app to test this:
>>
>> http://prologic.no-ip.org:8000/
>>
>> Source: http://codepad.org/zdZJgm1j
>>
>> Basically if you check for the string "iPad" in
>> the User-Agent header. Obviously this only
>> works for iPads running IOS and the built-in
>> Safari Web Browser - but I'm sure other tablet/mobile
>> devices provide similar unique User-Agent strings.
>>
>> cheers
>> James
>>
>> --
>> -- James Mills
>> --
>> -- "Problems are solved by method"
>> --
>> http://mail.python.org/mailman/listinfo/python-list
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110131/4536d06f/attachment.html>


More information about the Python-list mailing list