内容涉及中文时乱码类似:“\xe6\x80\xa7\xe4\xbc\xa0”
scrapy 直接对字符串解码
response.body.decode('utf-8')
requests可以对response指定编码
res = requests.get()
res.encoding='utf-8'
内容涉及中文时乱码类似:“\xe6\x80\xa7\xe4\xbc\xa0”
scrapy 直接对字符串解码
response.body.decode('utf-8')
requests可以对response指定编码
res = requests.get()
res.encoding='utf-8'