Closed LeslieWuboy closed 9 months ago
能提供更完整的报错信息么,你所提供的信息只能看出来是json转换的时候出现了错误
这个是输出的所有日志了,我尝试每两百个开启一次就不会出现这个报错。 不知道是不是获取分红的接口并没有做等待、重试的处理导致的。
嗯,数据接口是互联网的接口,存在部分无法获取报错的情况,代码中可以加入异常处理,如果发现接口有返回错误数据可以进行反馈。
明白了,还有一个问题就是获取所有股票代码的函数,我看源码是通过读取csv来获取的,为什么我在两个服务器同时执行这个函数却有不同的条数。 如下图,左侧是新获取的条数,右侧是原条数,新获取的反而更少了
所有代码是缓存和最新数据取交集的,建议在非交易时间获取所有代码。最新的数据可能网络原因获取失败
好的,感谢您的指导。
您好,很感谢您能提供如此强大的工具库,我在处理多线程获取股票分红信息时候,出现报错: in Response.json(self, kwargs) 970 try: --> 971 return complexjson.loads(self.text, kwargs) 972 except JSONDecodeError as e: 973 # Catch JSON-related errors and raise as requests.JSONDecodeError 974 # This aliases json.JSONDecodeError and simplejson.JSONDecodeError
File c:\Users\Leslie\miniconda3\envs\pytorch2\lib\json__init__.py:346, in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw) 343 if (cls is None and object_hook is None and 344 parse_int is None and parse_float is None and 345 parse_constant is None and object_pairs_hook is None and not kw): --> 346 return _default_decoder.decode(s) 347 if cls is None:
File c:\Users\Leslie\miniconda3\envs\pytorch2\lib\json\decoder.py:337, in JSONDecoder.decode(self, s, _w) 333 """Return the Python representation of
s
(astr
instance 334 containing a JSON document). 335 336 """ --> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end()) 338 end = _w(s, end).end()File c:\Users\Leslie\miniconda3\envs\pytorch2\lib\json\decoder.py:355, in JSONDecoder.raw_decode(self, s, idx) ... 973 # Catch JSON-related errors and raise as requests.JSONDecodeError 974 # This aliases json.JSONDecodeError and simplejson.JSONDecodeError --> 975 raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
麻烦帮忙指导指导,谢谢。