python编码iso-8859-9编码问题,pythoniso-8859-9,(2018-10-1


(2018-10-15)
2018骞?10鏈?16鏃?8:30鈥斺€?11:00锛屽湪鍏垽涓€搴叕寮€瀹$悊锛氬啀瀹$敵璇?..(2018-10-15)
2018骞?10鏈?16鏃?8:30鈥斺€?11:00锛屽湪鍏垽涓夊涵鍏紑瀹$悊锛氬啀瀹

res = requests.get(‘http://yczy.hljcourt.gov.cn/public/more.php?LocationID=0201000000‘)
res.encoding = res.apparent_encoding
print res.text.encode(‘iso-8859-9‘, ‘ignore‘).decode(‘gb2312‘, ‘ignore‘).encode(‘utf-8‘, ‘ignore‘)  # 其中ignore表示忽略特殊字符

python编码iso-8859-9编码问题

评论关闭