weiboSpider icon indicating copy to clipboard operation
weiboSpider copied to clipboard

爬到第111条微博时自动停止程序

Open biejingaoguai opened this issue 10 months ago • 2 comments

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

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

答:GitHub

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

答:是

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

答:否

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

答:

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

答:

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

答:C:\Users\AOOOOOOO\Desktop\weiboSpider-master\weiboSpider-master\weibo\华东扫地僧\video Progress: 1%|▉ | 11/832 [05:54<15:01:23, 65.88s/it]'NoneType' object has no attribute 'xpath' Traceback (most recent call last): File "C:\Users\AOOOOOOO\Desktop\weiboSpider-master\weiboSpider-master\weibo_spider\parser\page_parser.py", line 66, in get_one_page info = self.selector.xpath("//div[@class='c']") ^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'xpath' Progress: 1%|▉ | 11/832 [05:55<7:22:01, 32.30s/it] cannot unpack non-iterable NoneType object Traceback (most recent call last): File "C:\Users\AOOOOOOO\Desktop\weiboSpider-master\weiboSpider-master\weibo_spider\spider.py", line 180, in get_weibo_info weibos, self.weibo_id_list, to_continue = PageParser( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: cannot unpack non-iterable NoneType object 共爬取111条原创微博 信息抓取完毕 ****************************************************************************************************

以上是报错,我不太明白是被封禁了还是html在这里结构发生了改变,但是我程序运行暂停的短时间内无法访问weibo,cn,所以我是否要增加随机等待时间?还是说要其他操作

biejingaoguai avatar Feb 05 '25 09:02 biejingaoguai

可能是暂时被禁,或者网络原因,因为程序就是访问的weibo.cn,您也可以使用免cookie版,看看它是否可以使用。

dataabc avatar Feb 05 '25 13:02 dataabc

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] avatar May 06 '25 04:05 stale[bot]

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

stale[bot] avatar Jun 27 '25 01:06 stale[bot]