>>> import requests >>> r = requests.get('http://www.baidu.com') >>> bytes(r.text,r.encoding).decode('utf-8','ignore')