urllib user agent?

f29 f29 at gazeta.pl
Sun May 9 16:34:52 EDT 2004


Use urllib2 instead:

import urllib2
req=urllib2.Request(url='http://targeturl',headers={'User-Agent':'Mozilla/5.0
(Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113'})

You may also attach another headers using this comfortable dictionary
interface.

rgrds,
f29



More information about the Python-list mailing list