Skip to content

求助:很久没用程序运行出错,Cookie已更新 #672

@gqq969545903-del

Description

@gqq969545903-del

为了更好的解决问题,请认真回答下面的问题。等到问题解决,请及时关闭本issue。

  • 问:请您指明哪个版本运行出错(github版/PyPi版/全部)?

答:github版

  • 问:您使用的是否是最新的程序(是/否)?

答:是

  • 问:爬取任意用户都会运行出错吗(是/否)?

答:是

  • 问:若只有爬特定微博时才出错,能否提供出错微博的weibo_id或url(非必填)?

答:

  • 问:若您已提供出错微博的weibo_id或url,可忽略此内容,否则能否提供出错账号的user_id及您配置的since_date,方便我们定位出错微博(非必填)?

答:

  • 问:如果方便,请您描述出错详情,最好附上错误提示。

答:2025-09-07 18:11:05,432 - ERROR - index_parser.py[:44] - 'NoneType' object has no attribute 'xpath'
Traceback (most recent call last):
File "C:\Users\33726\AppData\Roaming\Python\Python312\site-packages\weibo_spider\parser\index_parser.py", line 33, in get_user
user_id = self._get_user_id()
^^^^^^^^^^^^^^^^^^^
File "C:\Users\33726\AppData\Roaming\Python\Python312\site-packages\weibo_spider\parser\index_parser.py", line 20, in _get_user_id
url_list = self.selector.xpath("//div[@Class='u']//a")
^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'xpath'
2025-09-07 18:11:05,446 - ERROR - spider.py[:242] - 'NoneType' object has no attribute 'nickname'
Traceback (most recent call last):
File "C:\Users\33726\AppData\Roaming\Python\Python312\site-packages\weibo_spider\spider.py", line 226, in _get_filepath
dir_name = self.user.nickname
^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'nickname'
2025-09-07 18:11:05,447 - ERROR - spider.py[:242] - 'NoneType' object has no attribute 'nickname'
Traceback (most recent call last):
File "C:\Users\33726\AppData\Roaming\Python\Python312\site-packages\weibo_spider\spider.py", line 226, in _get_filepath
dir_name = self.user.nickname
^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'nickname'
2025-09-07 18:11:05,448 - ERROR - spider.py[:330] - 'NoneType' object has no attribute 'dict'
Traceback (most recent call last):
File "C:\Users\33726\AppData\Roaming\Python\Python312\site-packages\weibo_spider\spider.py", line 313, in get_one_user
self.write_user(self.user)
File "C:\Users\33726\AppData\Roaming\Python\Python312\site-packages\weibo_spider\spider.py", line 137, in write_user
writer.write_user(user)
File "C:\Users\33726\AppData\Roaming\Python\Python312\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])
^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'dict'. Did you mean: 'dir'?

Metadata

Metadata

Assignees

No one assigned

    Labels

    failed程序运行出错

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions