用python3可能抓取可能遇到编码问题
# _*_ coding:utf-8 _*_
__author__ = 'zb'
import urllib3
http = urllib3.PoolManager()
r = http.request('GET','http://www.baidu.com/')
print (r.status)
print(r.data.decode())
UnicodeEncodeError: ‘gbk’ codec can’t encode character ‘\xbb’ in position 3654: illegal multibyte sequence
你可以用.decode(‘gbk’, errors=‘ignore’)来解码
如 print(r.data.decode(‘gbk’, errors=‘ignore’))