7-5 微博某大v所有帖子 - 图1

抓取的结果信息包含:

  • 帖子内容
  • 转发的帖子内容
  • 分享数
  • 评论数
  • 点赞数

    结果示例图:

    7-5 微博某大v所有帖子 - 图2

    模板:

    1. {"_id":"weibo-zuozhe","startUrl":["https://www.weibo.com/zhangyiming?is_search=0&visible=0&is_all=1&is_tag=0&profile_ftype=1&page=[1-5]#feedtop"],"selectors":[{"id":"info","type":"SelectorElementScroll","parentSelectors":["_root"],"selector":"div.WB_feed_type:nth-of-type(n+2)","multiple":true,"delay":"3000"},{"id":"content","type":"SelectorText","parentSelectors":["info"],"selector":"div.W_f14","multiple":false,"regex":"","delay":0},{"id":"forward","type":"SelectorText","parentSelectors":["info"],"selector":"div.WB_expand","multiple":false,"regex":"","delay":0},
    2. {"id":"forward-num","type":"SelectorText","parentSelectors":
    3. ["info"],"selector":"[node-type='forward_btn_text'] em:nth-of-type(2)","multiple":false,"regex":"","delay":0},{"id":"comments","type":"SelectorText","parentSelectors":
    4. ["info"],"selector":"[node-type='comment_btn_text'] em:nth-of-type(2)","multiple":false,"regex":"","delay":0},{"id":"likes","type":"SelectorText","parentSelectors":
    5. ["info"],"selector":".pos .line [node-type] em:nth-of-type(2)","multiple":false,"regex":"","delay":0},{"id":"time","type":"SelectorText","parentSelectors":["info"],"selector":"a[name]","multiple":false,"regex":"","delay":0}]}

    模板套用步骤:

    (1)进入需要抓取的大v微博主页,例如:https://weibo.com/alibuybuy?is_search=0&visible=0&is_all=1&is_tag=0&profile_ftype=1&page=1#feedtop
    (2)导入模板
    (3)替换 Start URL为要抓取的网页链接,(抓取多页需修改 Start URL 里的页码数)
    (4)开始抓取