urllib user agent?
Tim Heaney
theaney at cablespeed.com
Sat May 8 20:13:28 EDT 2004
Michael <mogmios at mlug.missouri.edu> writes:
> How do you change the user agent reported by urllib? I need to access
> a resource that rejects anything but IE.
Look under _urlopener in the urllib documentation
http://www.python.org/doc/current/lib/module-urllib.html
The example there seems to be just what you need...just change the
self.version line to something like
self.version = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)'
I hope this helps,
Tim
More information about the Python-list
mailing list