request = urllib2.Request('http://example.com/') request.add_header('User-agent', 'Mozilla/5.0 (Windows NT 6.1; WOW64)') response = urllib2.urlopen(request) html = response.read()