7-4 微博搜索结果话题栏信息 - 图1

抓取的结果信息包含:

  • 话题标题
  • 话题主页链接
  • 数据

    结果示例图:

    7-4 微博搜索结果话题栏信息 - 图2

    模板:

    1. {"_id":"weibo-ht","startUrl":["https://s.weibo.com/topic?q=%E5%86%99%E4%BD%9C&pagetype=topic&topic=1&Refer=pic_topic&page=[1-5]"],"selectors":[{"id":"info","type":"SelectorElement","parentSelectors":
    2. ["_root"],"selector":".m-con-l div.card","multiple":true,"delay":0},{"id":"title","type":"SelectorLink","parentSelectors":["info"],"selector":"a.name","multiple":false,"delay":0},{"id":"comments","type":"SelectorText","parentSelectors":
    3. ["info"],"selector":"p:nth-of-type(2)","multiple":false,"regex":"","delay":0}]}

    模板套用步骤:

    (1)进入需要抓取的文章搜索结果页面,例如:https://s.weibo.com/article?q=%E5%86%99%E4%BD%9C&Refer=user_article&page=1
    (2)导入模板
    (3)替换 Start URL为要抓取的网页链接,(抓取多页需修改 Start URL 里的页码数)
    (4)开始抓取