dataabc / weibo-crawler

新浪微博爬虫,用python爬取新浪微博数据,并下载微博图片和微博视频
3.33k stars 744 forks source link

免cookie版本抓取信息报错 #336

Closed tangke777 closed 1 year ago

tangke777 commented 1 year ago

配置信息: user_id : 1749127163 since_date: 2022-12-18 write_mode: json

问题情况如下: 先显示一部分抓取的内容,到最后报错如下: 辛苦看下 Progress: 0%| | 2/1522 [00:00<12:36, 2.01it/s] Expecting value: line 2 column 1 (char 1) Traceback (most recent call last): File "weibo.py", line 1893, in get_pages self.write_data(wrote_count) # 将剩余不足20页的微博写入文件 File "weibo.py", line 1837, in write_data self.write_json(wrote_count) File "weibo.py", line 1351, in write_json data = json.load(f) File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/json/init.py", line 293, in load return loads(fp.read(), File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/json/init.py", line 357, in loads return _default_decoder.decode(s) File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/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 1) 信息抓取完毕

tangke777 commented 1 year ago

已解决 原因为缺少json文件