On 03/11/2011 09:59 AM, Νικόλαος Κούρας wrote:
******************
agent = os.environ['HTTP_USER_AGENT']

# determination of user browser
agent = agent.lower()
if 'chrome' in agent:
        agent = 'Chrome'
if 'firefox' in agent:
        agent = 'Firefox'
if 'opera' in agent:
        agent = 'Opera'
if 'safari' in agent:
        agent = 'Safari'
if 'msie' in agent:
        agent = 'IE'
***************

I just want to have an idea of what browser a guest is using when
hitting my webpage.

http://www.superhost.gr/?show=log

now includes also that filed in the logging process.

I now have a sudden urge to use Firefox's User-Agent Switcher add-on to change my UA string to something like "Chrome Firefox MSIE Opera Safari Mozilla Lynx Links Dillo Win32 Windows Linux OpenBSD Mac OS X" and browse your site :)

-tkc



--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to