I try to parse this little json, i want to take the number :
{"nombre":18747}
I try :
import urllib.request
request = urllib.request.Request("http://myurl.com")
response = urllib.request.urlopen(request)
print (response.read().decode('utf-8')) //print -> {"nombre":18747}
import json
json = (response.read().decode('utf-8'))
json.loads(json)
But I have:
Traceback (most recent call last):
File "<pyshell#38>", line 1, in <module>
json.loads('json')
AttributeError: 'str' object has no attribute 'loads'
Any help?