7-2 微博搜索结果用户栏信息 - 图1

抓取的结果信息包含:

  • 用户名字
  • 用户微博主页
  • 地址
  • 关注大v数
  • 粉丝数
  • 发布微博数
  • 简介
  • 标签
  • 教育

    结果示例图:

    7-2 微博搜索结果用户栏信息 - 图2

    模板:

    1. {"_id":"weibo-user","startUrl":["https://s.weibo.com/user?q=%E5%86%99%E4%BD%9C&Refer=weibo_user&page=[1-5]"],"selectors":[{"id":"info","type":"SelectorElement","parentSelectors":
    2. ["_root"],"selector":".m-con-l div.card","multiple":true,"delay":0},{"id":"name","type":"SelectorLink","parentSelectors":["info"],"selector":"a.name","multiple":false,"delay":0},{"id":"address","type":"SelectorText","parentSelectors":
    3. ["info"],"selector":"p:nth-of-type(1)","multiple":false,"regex":"","delay":0},{"id":"following","type":"SelectorText","parentSelectors":
    4. ["info"],"selector":"span:nth-of-type(1)","multiple":false,"regex":"","delay":0},{"id":"followers","type":"SelectorText","parentSelectors":
    5. ["info"],"selector":"span:nth-of-type(2)","multiple":false,"regex":"","delay":0},{"id":"contents","type":"SelectorText","parentSelectors":
    6. ["info"],"selector":"span.s-nobr","multiple":false,"regex":"","delay":0},{"id":"intro","type":"SelectorText","parentSelectors":
    7. ["info"],"selector":"p:nth-of-type(4)","multiple":false,"regex":"","delay":0},{"id":"tag","type":"SelectorText","parentSelectors":
    8. ["info"],"selector":"p:nth-of-type(5)","multiple":false,"regex":"","delay":0},{"id":"edu","type":"SelectorText","parentSelectors":
    9. ["info"],"selector":"p:nth-of-type(6)","multiple":false,"regex":"","delay":0}]}

    模板套用步骤:

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