python - Looping r.json , Limited -
i have loop request , process. repeats, after while it's dead
def getsize(): r = requests.get("http://domain.com/api/v1/getize") loop in r.json(): getsizeguide(loop['link'],loop['id']) def getsizeguide(link,id): //does getsize() file "c:\users\administrator\desktop\python\xxx\sizeguide2.py", line 150, in getsizeguide getsize() file "c:\users\administrator\desktop\python\xxx\sizeguide2.py", line 34, in getsize loop in r.json(): file "c:\python34\lib\site-packages\requests\models.py", line 763, in json return json.loads(self.text, **kwargs) file "c:\python34\lib\json\__init__.py", line 318, in loads return _default_decoder.decode(s) file "c:\python34\lib\json\decoder.py", line 343, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) file "c:\python34\lib\json\decoder.py", line 361, in raw_decode raise valueerror(errmsg("expecting value", s, err.value)) none valueerror: expecting value: line 1 column 1 (char 0)
Comments
Post a Comment