dataabc / weibo-crawler

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

TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType #358

Open twilight1024 opened 1 year ago

twilight1024 commented 1 year ago

stat: path should be string, bytes, os.PathLike or integer, not NoneType Traceback (most recent call last): File "D:\weibo-crawler-master4\weibo-crawler-master\weibo.py", line 1883, in get_pages self.write_data(wrote_count) File "D:\weibo-crawler-master4\weibo-crawler-master\weibo.py", line 1836, in write_data self.write_csv(wrote_count) File "D:\weibo-crawler-master4\weibo-crawler-master\weibo.py", line 1293, in write_csv self.csv_helper(result_headers, result_data, file_path) File "D:\weibo-crawler-master4\weibo-crawler-master\weibo.py", line 1297, in csv_helper if not os.path.isfile(file_path): File "D:\anaconda\lib\genericpath.py", line 30, in isfile st = os.stat(path) TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType 信息抓取完毕


dataabc commented 1 year ago

是不是运行时删除了生成的文件夹?

twilight1024 commented 1 year ago

是不是运行时删除了生成的文件夹?

哦对,不小心删除了,但是现在最大的问题是,加了cookie之后还是不能获取200页以后的微博

dataabc commented 1 year ago

不知道是不是微博限制了,可以使用cookie版,这个应该可以。

twilight1024 commented 1 year ago

不知道是不是微博限制了,可以使用cookie版,这个应该可以。

cookie版在哪里呀?

dataabc commented 1 year ago

https://github.com/dataabc/weiboSpider

twilight1024 commented 1 year ago

https://github.com/dataabc/weiboSpider weiboSpider-master\weibospider_init.py的文件是0kb,是不是残缺了呀?

dataabc commented 1 year ago

没有啊。

twilight1024 commented 1 year ago

没有啊。

可是下载好的数据包里的文件是0kb

dataabc commented 1 year ago

和这个没关系。

twilight1024 commented 1 year ago

和这个没关系。

好的好的,那我再运行试试~