json.decoder.JSONDecodeError(问题已解决)

import json

from io import StringIO

rsponse0='{"name":"梅欢庆","Gender":"male","age":"23"}'
rsponse1='[0,1,2,3,4,5,6]'
#比如rsp是字符串
ioa = StringIO(rsponse0)
iob = StringIO(rsponse1)
jsonPra = json.load(ioa)
jsonPrb = json.load(ioa)
print(jsonPra)#打印结果为{"name":"梅欢庆","Gender":"male","age":"23"}
print(jsonPrb)#打印结果为[0,1,2,3,4,5,6]
所以综上可以看出只是把外面的引号去掉了而已

 

你可能感兴趣的:(动态网页的爬取)