import urllib2
cookies = urllib2.HTTPCookieProcessor()
opener = urllib2.build_opener(cookies)
f = opener.open('http://weixin.sogou.com/weixin?query=HTML5&_sug_type_=&_sug_=n&type=1&page=2&ie=utf8')
request = urllib2.Request(
url = 'http://weixin.sogou.com/weixin?query=HTML5&_sug_type_=&_sug_=n&type=1&page=2&ie=utf8',
headers = {'Cookie' : 'SUV=00DC178CDCA80C6E58131A0AB5711981; CXID=7A54970D99F7CC9284BF18D8B8A491C4; ad=2KnwjZllll2Y3yPvlllllVkIu5UlllllrZOyhylll3ylllllRklll5@@@@@@@@@@; SUID=C95009AF546C860A58290852000BBF33; ABTEST=0|1479195363|v1; SNUID=DEB120832D296D7E2F1C83842DF72818; weixinIndexVisited=1; sct=4; ppinf=5|1479259384|1480468984|dHJ1c3Q6MToxfGNsaWVudGlkOjQ6MjAxN3x1bmlxbmFtZTo1NDolRTUlOTMlQTUlRTUlQkUlQjclRTUlQjclQjQlRTglQjUlQUIlRTclOEMlOUMlRTYlODMlQjN8Y3J0OjEwOjE0NzkyNTkzODR8cmVmbmljazo1NDolRTUlOTMlQTUlRTUlQkUlQjclRTUlQjclQjQlRTglQjUlQUIlRTclOEMlOUMlRTYlODMlQjN8dXNlcmlkOjQ0OjM4Rjg2MzE0MjdBRTIzMjFGODUwQkI2MTM3QkJCNTU5QHFxLnNvaHUuY29tfA; pprdig=ZnAYPvQ737V09nx3iUpZtdDov4QuOJFGCKj9_Ja4FXsdsfo18iJnHrwGfQZcEjm7MzVpnRKm5Oi1xYodvxBgcMXz8MWba4-9SJYzJvstyzAKBKvTjAx_cgX9_TF2GY2WqP2xitm9Es5p9-HEjCNDOzLCqGB81O2NiyzIb2p2BgM; ppmdig=1479363039000000d4066553a9227d6e30bda10050021285; JSESSIONID=aaak4d4gXQcP9aaPFzwFv; IPLOC=CN4300'})
html = opener.open(request)
print(html.read())
python带cookies请求一般用来做爬虫得到页面结果后再利用HTML分析的库进行筛选需要的内容