摘要:
解决思路1、 循环暴力寻找编码,但是不如思路3 def parse(self, response): print(response.text[:100]) body = response.body#直接是bytes,response.text是str encodings = ['utf-8', 'g 阅读全文
posted @ 2022-11-23 14:45
kuba8
阅读(312)
评论(0)
推荐(0)
摘要:
首先查看页面的编码模式 response.encoding 显示为'cp1252' response.xpath("//title/text()").getall()[0].encode('cp1252').decode('gbk') 解决。 阅读全文
posted @ 2022-11-23 11:15
kuba8
阅读(282)
评论(0)
推荐(0)