Skip to content

全部安好运行后,在网页点击搜索报错 #11

@liuyizhuo11235

Description

@liuyizhuo11235
    大佬,当在前端网页点击搜索按钮时,爬虫报错

Traceback (most recent call last):
File "C:\Users\hl199\Topic_and_user_profile_analysis_system-master\code\weibo_crawler\selector_parser\search_weibo_parser.py", line 22, in parse_page
weibo_list = self._get_all_weibo()
File "C:\Users\hl199\Topic_and_user_profile_analysis_system-master\code\weibo_crawler\selector_parser\search_weibo_parser.py", line 33, in _get_all_weibo
for weibo in self._parse_weibo():
File "C:\Users\hl199\Topic_and_user_profile_analysis_system-master\code\weibo_crawler\selector_parser\search_weibo_parser.py", line 55, in _parse_weibo
weibo['weibo_id'] = sel.xpath('(.//p[@Class="from"])[last()]/a[1]/@href')[0].split('/')[-1].split('?')[0]
IndexError: list index out of range
似乎是微博没有返回任何东西,是我爬虫配置出错了吗?
同时main.py报错pymongo.errors.ServerSelectionTimeoutError: 127.0.0.1:27017: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
请问该怎么解决?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions