このブログを検索

2013/03/06

user agentの変更

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()