def getInfoJson(url):
#response = getResponse(url)
response = urllib.request.urlopen(url)
data = response.read().decode("utf-8")
print ("data:%s"%data)
mJson = json.loads(data)#将字符串转化成字典
return mJson
上述代码,执行json.loads()报错
def getInfoJson(url):
#response = getResponse(url)
response = urllib.request.urlopen(url)
data = response.read().decode("utf-8")
print ("data:%s"%data)
mJson = json.loads(data)#将字符串转化成字典
return mJson
上述代码,执行json.loads()报错