Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Json解析报错 #46

Open
BoffinZhang opened this issue Jan 5, 2023 · 4 comments
Open

Json解析报错 #46

BoffinZhang opened this issue Jan 5, 2023 · 4 comments

Comments

@BoffinZhang
Copy link

BoffinZhang commented Jan 5, 2023

本周开始study.py中的haveLearned = bjySession.get(learnedInfo).json()运行报错,看起来像Json Decoder的问题,报错信息如下:

账号数量:2
--User 1--
登录成功
Traceback (most recent call last):
  File "C:\Users\PathfinderZ\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
  File "C:\Users\PathfinderZ\AppData\Local\Programs\Python\Python310\lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "C:\Users\PathfinderZ\AppData\Local\Programs\Python\Python310\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\PathfinderZ\AppData\Local\Programs\Python\Python310\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 2 column 1 (char 2)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\01.Code\Beijing_Daxuexi_Simple-main\main.py", line 70, in <module>
    if study(username, password, ua):
  File "D:\01.Code\Beijing_Daxuexi_Simple-main\study.py", line 62, in study
    haveLearned = bjySession.get(learnedInfo).json()
  File "C:\Users\PathfinderZ\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 2 column 1 (char 2)
@JoeQinOvO
Copy link

我也遇到了同样问题

@zzy99
Copy link

zzy99 commented Jan 6, 2023

是不是因为假期大学习停止了

@surreyskahn
Copy link

暂时没有大学习了,开心吧

@Eason0921
Copy link

是否应该加一个报错提示?完善下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants