Skip to content

爬取用户帖子失败 #686

@whale-withme

Description

@whale-withme

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

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

答:github

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

答:是

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

答:是

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

答:

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

答:

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

答:爬取特定用户的时候,可能是之前触发了反爬?导致反复出现以下error:


Progress: 0%| | 0/1 [00:00<?, ?it/s]list index out of range
Traceback (most recent call last):
File "/root/Mean-Field-LLM/weiboSpider/weibo_spider/parser/page_parser.py", line 67, in get_one_page
is_exist = info[0].xpath("div/span[@Class='ctt']")
~~~~^^^
IndexError: list index out of range
Progress: 0%| | 0/1 [00:00<?, ?it/s]
cannot unpack non-iterable NoneType object
Traceback (most recent call last):
File "/root/Mean-Field-LLM/weiboSpider/weibo_spider/spider.py", line 228, in get_weibo_info
weibos, self.weibo_id_list, to_continue = PageParser(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: cannot unpack non-iterable NoneType object
共爬取0条微博
信息抓取完毕
我已经增加了爬虫的间歇,但还是在100多user爬取各20条帖子之后出现这个问题,请教如何解决

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