内容涉及中文时乱码类似:“\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'
本文标题:scrapy | scrapy 和 requests分别对re
本文链接:https://www.haomeiwen.com/subject/hpxxfhtx.html
网友评论