* Adrian Smith <[EMAIL PROTECTED]> [2007-07-03 08:14:32]: > some access. Apparently there's a way to change the user-agent string > by subclassing urllib's URLopener class, but that's beyond my comfort > zone at present.
Read the urllib2 how-to located at ActiveState Documentation pages. That gives the concise snippets as how you will set the USER-AGENT string. <snip> import urllib import urllib2 url = 'http://www.someserver.com/cgi-bin/register.cgi' user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' values = {'name' : 'Michael Foord', 'location' : 'Northampton', 'language' : 'Python' } headers = { 'User-Agent' : user_agent } data = urllib.urlencode(values) req = urllib2.Request(url, data, headers) response = urllib2.urlopen(req) the_page = response.read() </snip> -- O.R.Senthil Kumaran http://uthcode.sarovar.org -- http://mail.python.org/mailman/listinfo/python-list