<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
则写代码时注意转码
html=html.decode("gbk","ignore").encode('utf-8')
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
则写代码时注意转码
html=html.decode("gbk","ignore").encode('utf-8')
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
转载于:https://www.cnblogs.com/ZHANG576433951/p/6101948.html