如何在python中将字节转换为字符串

时间:2018-08-16 23:33:06

标签: python byte

我从这样的网页上获取内容

url = 'http://s0.icaipiao123.com/api/v2/rank/landing?lottery_key=shuangseqiu'
scode = requests.get(url).content

print(scode.decode('utf8'))

print(type(scode))

print(scode.decode())

错误是 'utf-8'编解码器无法解码位置5的字节0xeb:无效的连续字节

enter image description here 如何将字节转换为字符串,谢谢

0 个答案:

没有答案
相关问题