答:
PS D:\下载\qq\3105088783\FileRecv\2024大二下\认识实习\weiboSpider-master> & D:/Anaconda/python.exe d:/下载/qq/3105088783/FileRecv/2024大二下/认识实习/weiboSpider-master/weiboSpider-master/weibo_spider/main.py
list index out of range
Traceback (most recent call last):
File "C:\Users\JackieTao\AppData\Roaming\Python\Python310\site-packages\weibo_spider\parser\index_parser.py", line 39, in get_user
self.user.weibo_num = string_to_int(user_info[0][3:-1])
IndexError: list index out of range
None
'NoneType' object has no attribute 'nickname'
Traceback (most recent call last):
File "C:\Users\JackieTao\AppData\Roaming\Python\Python310\site-packages\weibo_spider\spider.py", line 226, 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 "C:\Users\JackieTao\AppData\Roaming\Python\Python310\site-packages\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 "C:\Users\JackieTao\AppData\Roaming\Python\Python310\site-packages\weibo_spider\spider.py", line 226, 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 "C:\Users\JackieTao\AppData\Roaming\Python\Python310\site-packages\weibo_spider\spider.py", line 313, in get_one_user
self.write_user(self.user)
File "C:\Users\JackieTao\AppData\Roaming\Python\Python310\site-packages\weibo_spider\spider.py", line 137, in write_user
writer.write_user(user)
File "C:\Users\JackieTao\AppData\Roaming\Python\Python310\site-packages\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 "C:\Users\JackieTao\AppData\Roaming\Python\Python310\site-packages\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'
PS D:\下载\qq\3105088783\FileRecv\2024大二下\认识实习\weiboSpider-master>
为了更好的解决问题,请认真回答下面的问题。等到问题解决,请及时关闭本issue。
答:github
答:是
答:是
答:
答:
答: PS D:\下载\qq\3105088783\FileRecv\2024大二下\认识实习\weiboSpider-master> & D:/Anaconda/python.exe d:/下载/qq/3105088783/FileRecv/2024大二下/认识实习/weiboSpider-master/weiboSpider-master/weibo_spider/main.py list index out of range Traceback (most recent call last): File "C:\Users\JackieTao\AppData\Roaming\Python\Python310\site-packages\weibo_spider\parser\index_parser.py", line 39, in get_user self.user.weibo_num = string_to_int(user_info[0][3:-1]) IndexError: list index out of range None
'NoneType' object has no attribute 'nickname' Traceback (most recent call last): File "C:\Users\JackieTao\AppData\Roaming\Python\Python310\site-packages\weibo_spider\spider.py", line 226, in _get_filepath
[v + ':' + str(self.user.dict[k]) for k, v in self.user_desc])
AttributeError: 'NoneType' object has no attribute 'dict'
PS D:\下载\qq\3105088783\FileRecv\2024大二下\认识实习\weiboSpider-master>
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 "C:\Users\JackieTao\AppData\Roaming\Python\Python310\site-packages\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 "C:\Users\JackieTao\AppData\Roaming\Python\Python310\site-packages\weibo_spider\spider.py", line 226, 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 "C:\Users\JackieTao\AppData\Roaming\Python\Python310\site-packages\weibo_spider\spider.py", line 313, in get_one_user
self.write_user(self.user) File "C:\Users\JackieTao\AppData\Roaming\Python\Python310\site-packages\weibo_spider\spider.py", line 137, in write_user
writer.write_user(user) File "C:\Users\JackieTao\AppData\Roaming\Python\Python310\site-packages\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 "C:\Users\JackieTao\AppData\Roaming\Python\Python310\site-packages\weibo_spider\writer\txt_writer.py", line 29, in