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