pyhton爬虫乱码解决思路:
1、比对html>head>meta中的charset设定的编码类型
2、设定为默认编码类型为所存储内容,response.encoding = 'UTF-8'
3with open('poems.txt','w',encoding='UTF-8') as f:写入的时候encoding='UTF-8'配置文件的默认配置
pyhton爬虫乱码解决思路:
1、比对html>head>meta中的charset设定的编码类型
2、设定为默认编码类型为所存储内容,response.encoding = 'UTF-8'
3with open('poems.txt','w',encoding='UTF-8') as f:写入的时候encoding='UTF-8'配置文件的默认配置