代码是老师的源码(路径修改为本地自己的了)具体报错:
C:\Python37\python.exe “C:\Program Files\JetBrains\PyCharm Community Edition 2018.1.4\helpers\pydev\pydevd.py” --multiproc --qt-support=auto --client 127.0.0.1 --port 51804 --file D:/project/project/part_two/jingdong2.py
Connected to pydev debugger (build 181.5087.37)
pydev debugger: process 5284 is connecting
Traceback (most recent call last):
File “C:\Program Files\JetBrains\PyCharm Community Edition 2018.1.4\helpers\pydev\pydevd.py”, line 1664, in
main()
File “C:\Program Files\JetBrains\PyCharm Community Edition 2018.1.4\helpers\pydev\pydevd.py”, line 1658, in main
globals = debugger.run(setup[‘file’], None, None, is_module)
File “C:\Program Files\JetBrains\PyCharm Community Edition 2018.1.4\helpers\pydev\pydevd.py”, line 1068, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File “C:\Program Files\JetBrains\PyCharm Community Edition 2018.1.4\helpers\pydev_pydev_imps_pydev_execfile.py”, line 18, in execfile
exec(compile(contents+"\n", file, ‘exec’), glob, loc)
File “D:/project/project/part_two/jingdong2.py”, line 161, in
login_status = check_cookies()
File “D:/project/project/part_two/jingdong2.py”, line 45, in check_cookies
driver = save_cookies_to_driver()
File “D:/project/project/part_two/jingdong2.py”, line 61, in save_cookies_to_driver
jd_cookies_dict = json.loads(jd_cookies_str)
File “C:\Python37\lib\json_init_.py”, line 348, in loads
return _default_decoder.decode(s)
File “C:\Python37\lib\json\decoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “C:\Python37\lib\json\decoder.py”, line 355, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)