7-1 微博搜索结果综合栏信息 - 图1

抓取的结果信息包含:

  • 微博内容
  • 作者
  • 转发数
  • 评论数
  • 喜欢数

    结果示例图:

    7-1 微博搜索结果综合栏信息 - 图2

    模板:

    1. {"_id":"weibo-zonghe","startUrl":["https://s.weibo.com/weibo/%25E5%2586%2599%25E4%25BD%259C?topnav=1&wvr=6&b=1&page=[1-5]"],"selectors":[{"id":"info","type":"SelectorElement","parentSelectors":["_root"],"selector":".m-con-l div.card","multiple":true,"delay":0},{"id":"content","type":"SelectorText","parentSelectors":["info"],"selector":"p.txt","multiple":false,"regex":"","delay":0},{"id":"author","type":"SelectorText","parentSelectors":["info"],"selector":"a.name","multiple":false,"regex":"","delay":0},{"id":"forward","type":"SelectorText","parentSelectors":
    2. ["info"],"selector":".card-act li:nth-of-type(2)","multiple":false,"regex":"","delay":0},{"id":"comments","type":"SelectorText","parentSelectors":
    3. ["info"],"selector":".card-act li:nth-of-type(3)","multiple":false,"regex":"","delay":0},{"id":"likes","type":"SelectorText","parentSelectors":
    4. ["info"],"selector":".card-act li:nth-of-type(4)","multiple":false,"regex":"","delay":0}]}

    模板套用步骤:

    (1)进入需要抓取的微博搜索结果页面,例如:https://s.weibo.com/weibo/%25E5%2586%2599%25E4%25BD%259C?topnav=1&wvr=6&b=1&page=1
    (2)导入模板
    (3)替换 Start URL为要抓取的网页链接,(抓取多页需修改 Start URL 里的页码数)
    (4)开始抓取