I get the content from webpage like this
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())
The error is 'utf-8' codec can't decode byte 0xeb in position 5: invalid continuation byte
Try this:
import codecs
#scode data variable
codecs.decode(scode, 'UTF-8')
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.