課程
/后端開發(fā)
/Python
/Python開發(fā)簡單爬蟲
Python2.7為什么爬百度后出現(xiàn)的結果亂碼哪?
2017-07-27
源自:Python開發(fā)簡單爬蟲 5-3
正在回答
python2編碼確實有點問題,你可以import sys?reload(sys) ?sys.setdefaultencoding("utf-8")
哈哈哈懶婷 提問者
#在output.html里面修改一下就好了,在fout.write("<html>")之后加上這幾行 fout.write("<head>") fout.write("<meta?http-equiv='content-type'?content='text/html;charset=utf-8'>") fout.write("</head>")
舉報
本教程帶您解開python爬蟲這門神奇技術的面紗
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2017-07-27
python2編碼確實有點問題,你可以import sys?reload(sys) ?sys.setdefaultencoding("utf-8")
2017-07-28