dataabc / weiboSpider

新浪微博爬虫,用python爬取新浪微博数据
8.37k stars 1.98k forks source link

报错没有nickname属性 #470

Closed yhlhhhhh closed 1 year ago

yhlhhhhh commented 2 years ago

系统是Mac OS,python版本是3.9 报错信息 2022-08-22 16:16:57,628 - spider.py - ERROR - 'NoneType' object has no attribute 'nickname' Traceback (most recent call last): File "/Users/yanghaolin/weiboSpider/weibo_spider/spider.py", line 227, in _get_filepath dir_name = self.user.nickname AttributeError: 'NoneType' object has no attribute 'nickname' 2022-08-22 16:16:57,629 - csv_writer.py - ERROR - expected str, bytes or os.PathLike object, not NoneType Traceback (most recent call last): File "/Users/yanghaolin/weiboSpider/weibo_spider/writer/csv_writer.py", line 25, in init with open(self.file_path, 'a', encoding='utf-8-sig', TypeError: expected str, bytes or os.PathLike object, not NoneType 2022-08-22 16:16:57,629 - spider.py - ERROR - 'NoneType' object has no attribute 'nickname' Traceback (most recent call last): File "/Users/yanghaolin/weiboSpider/weibo_spider/spider.py", line 227, in _get_filepath dir_name = self.user.nickname AttributeError: 'NoneType' object has no attribute 'nickname' 2022-08-22 16:16:57,629 - spider.py - ERROR - 'NoneType' object has no attribute 'dict' Traceback (most recent call last): File "/Users/yanghaolin/weiboSpider/weibo_spider/spider.py", line 314, in get_one_user self.write_user(self.user) File "/Users/yanghaolin/weiboSpider/weibo_spider/spider.py", line 138, in write_user writer.write_user(user) File "/Users/yanghaolin/weiboSpider/weibo_spider/writer/txt_writer.py", line 29, in write_user [v + ':' + str(self.user.dict[k]) for k, v in self.user_desc]) File "/Users/yanghaolin/weiboSpider/weibo_spider/writer/txt_writer.py", line 29, in [v + ':' + str(self.user.dict[k]) for k, v in self.user_desc]) AttributeError: 'NoneType' object has no attribute 'dict'

dataabc commented 2 years ago

应该是被暂时限制了,一段时间后,限制会自动解除。

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 1 year ago

Closing as stale, please reopen if you'd like to work on this further.