Error In querying Genderize.io. Can someone please help

handar94 at gmail.com handar94 at gmail.com
Thu Dec 1 16:45:16 EST 2016


import requests
import json
names={'katty','Shean','Rajat'};
for name in names:
    request_string="http://api.genderize.io/?"+name
    r=requests.get(request_string)
    result=json.loads(r.content)


Error-----------
Traceback (most recent call last):
  File "C:/Users/user/PycharmProjects/untitled7/Mis1.py", line 7, in <module>
    result=json.loads(r.content)
  File "C:\Users\user\Anaconda2\lib\json\__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "C:\Users\user\Anaconda2\lib\json\decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\user\Anaconda2\lib\json\decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

Can someone please help.


More information about the Python-list mailing list