list index out of range
Traceback (most recent call last):
File "/Users/xiaoqb/weibo_autoSurfing/weiboSpider/weibo_spider/parser/info_parser.py", line 39, in extract_user_info
if self.selector.xpath(
IndexError: list index out of range
'NoneType' object has no attribute 'id'
Traceback (most recent call last):
File "/Users/xiaoqb/weibo_autoSurfing/weiboSpider/weibo_spider/parser/index_parser.py", line 36, in get_user
self.user.id = user_id
AttributeError: 'NoneType' object has no attribute 'id'
None
'NoneType' object has no attribute 'nickname'
Traceback (most recent call last):
File "/Users/xiaoqb/weibo_autoSurfing/weiboSpider/weibo_spider/spider.py", line 215, in _get_filepath
dir_name = self.user.nickname
AttributeError: 'NoneType' object has no attribute 'nickname'
expected str, bytes or os.PathLike object, not NoneType
Traceback (most recent call last):
File "/Users/xiaoqb/weibo_autoSurfing/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
'NoneType' object has no attribute 'nickname'
Traceback (most recent call last):
File "/Users/xiaoqb/weibo_autoSurfing/weiboSpider/weibo_spider/spider.py", line 215, in _get_filepath
dir_name = self.user.nickname
AttributeError: 'NoneType' object has no attribute 'nickname'
'NoneType' object has no attribute 'dict'
Traceback (most recent call last):
File "/Users/xiaoqb/weibo_autoSurfing/weiboSpider/weibo_spider/spider.py", line 302, in get_one_user
self.write_user(self.user)
File "/Users/xiaoqb/weibo_autoSurfing/weiboSpider/weibo_spider/spider.py", line 136, in write_user
writer.write_user(user)
File "/Users/xiaoqb/weibo_autoSurfing/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/xiaoqb/weibo_autoSurfing/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'
github版本,macOS,设置完成后第一次运行,报如下错误:
list index out of range Traceback (most recent call last): File "/Users/xiaoqb/weibo_autoSurfing/weiboSpider/weibo_spider/parser/info_parser.py", line 39, in extract_user_info if self.selector.xpath( IndexError: list index out of range 'NoneType' object has no attribute 'id' Traceback (most recent call last): File "/Users/xiaoqb/weibo_autoSurfing/weiboSpider/weibo_spider/parser/index_parser.py", line 36, in get_user self.user.id = user_id AttributeError: 'NoneType' object has no attribute 'id' None
'NoneType' object has no attribute 'nickname' Traceback (most recent call last): File "/Users/xiaoqb/weibo_autoSurfing/weiboSpider/weibo_spider/spider.py", line 215, in _get_filepath dir_name = self.user.nickname AttributeError: 'NoneType' object has no attribute 'nickname' expected str, bytes or os.PathLike object, not NoneType Traceback (most recent call last): File "/Users/xiaoqb/weibo_autoSurfing/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 'NoneType' object has no attribute 'nickname' Traceback (most recent call last): File "/Users/xiaoqb/weibo_autoSurfing/weiboSpider/weibo_spider/spider.py", line 215, in _get_filepath dir_name = self.user.nickname AttributeError: 'NoneType' object has no attribute 'nickname' 'NoneType' object has no attribute 'dict' Traceback (most recent call last): File "/Users/xiaoqb/weibo_autoSurfing/weiboSpider/weibo_spider/spider.py", line 302, in get_one_user self.write_user(self.user) File "/Users/xiaoqb/weibo_autoSurfing/weiboSpider/weibo_spider/spider.py", line 136, in write_user writer.write_user(user) File "/Users/xiaoqb/weibo_autoSurfing/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/xiaoqb/weibo_autoSurfing/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'