[Tutor] user agent

jeremiah jeremiah.jester at panasonic.aero
Thu Sep 25 00:55:12 CEST 2008

I'm trying to force the user agent in a python login script... My
question is what are the possible user agents I can specify and how do I
print the user agent at the end of the script so I know that it was
accurately saved. Here is the first bit of my code.
Any suggestions?




import cookielib, urllib2
import urllib

cookie_jar = cookielib.CookieJar()
opener = urllib2.build_opener( urllib2.HTTPCookieProcessor(cookie_jar) )

""" User Agent Setting - change ua_value to modify user agent options
are: 'Mozilla/5.0', 'ie5' """
opener.addheaders = [('User-agent', ua_value)]

Disclaimer: The information contained in this transmission, including any 
attachments, may contain confidential information of Panasonic Avionics
Corporation.  This transmission is intended only for the use of the 
addressee(s) listed above.  Unauthorized review, dissemination or other use 
of the information contained in this transmission is strictly prohibited. 
If you have received this transmission in error or have reason to believe 
you are not authorized to receive it, please notify the sender by return 
email and promptly delete the transmission.

More information about the Tutor mailing list