def jsons(r, p=0): dec = json.JSONDecoder(encoding='utf-8') while True: obj,p = dec.scan_once(r.text,p) yield obj