写网页内容代码报错
来源:3-2 Requests 模块请求网页数据

慕娘8588455
2023-03-12
with open("./C03L02/index.html", "w") as f:
f.write(res.text)
报错
UnicodeEncodeError: 'gbk' codec can't encode character '\xa0' in position 598288: illegal multibyte sequence
写回答
1回答
-
Martin__Wang
2023-03-12
with open("./C03L02/index.html", "w", encoding="utf-8") as f:
f.write(res.text)
012023-03-13
相似问题