TA貢獻1831條經驗 獲得超4個贊
r.text[:1000].encode("utf-8")
r.text[:1000].encode("GB2312")
r.text[:1000].decode("utf-8")
r.text[:1000].decode("gb2312")
四種方法,一個一個試試,看看那個可以了就確定用那個。
TA貢獻1725條經驗 獲得超8個贊
情景1:
print(rep.text[:1000]) #顯示中文
情景2:unicode轉str
print(rep.text.encode('utf-8','ignore')[:1000])
從 0 開始學爬蟲
¥ 68.00
舉報
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號