sixs / wenshu_spider

中国裁判文书网爬虫(2018-08-28更新)
https://github.com/sixs/wenshu_spider
337 stars 107 forks source link

验证码错误 #12

Open koko12131 opened 6 years ago

koko12131 commented 6 years ago

我使用的是py3.6.1(64位) 将项目导入pycharm运行后得到以下错误

第1页

出现验证码 识别验证码为:1 验证码错误 识别验证码为:1

第1页

Traceback (most recent call last): File "G:/coding/wenshu_spider-master/court.py", line 393, in get_data(Param,Page,Order,Direction) File "G:/coding/wenshu_spider-master/court.py", line 252, in get_data json_data = json.loads(return_data) File "C:\Users\Andrew\AppData\Local\Programs\Python\Python36\lib\json__init__.py", line 354, in loads return _default_decoder.decode(s) File "C:\Users\Andrew\AppData\Local\Programs\Python\Python36\lib\json\decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Users\Andrew\AppData\Local\Programs\Python\Python36\lib\json\decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

sixs commented 5 years ago

1、验证码识别已经失效了,把验证码识别和验证注释掉 2、返回的数据return_data不是json字符串,打印下看看是什么,然后加个条件判断