原文:'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte

问题描述:在使用python爬取斗鱼直播的数据时,使用str 读取到的字节,编码格式 进行解码时报错: utf codec can t decode byte x b in position : invalid start byte 代码如下: 问题原因:断点调试的时候发现r.read 获取到的字节码是以 b x f x b x 开头的,说明它是gzip压缩过的数据,这也是报错的原因,所以我们需要 ...

2020-04-03 15:27 0 1239 推荐指数:

查看详情

 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM