7-3 微博搜索结果文章栏信息 - 图1

抓取的结果信息包含:

  • 文章标题
  • 文章内容链接
  • 作者
  • 分享数
  • 点赞数
  • 时间

    结果示例图:

    7-3 微博搜索结果文章栏信息 - 图2

    模板:

    1. {"_id":"weibo-wz","startUrl":["https://s.weibo.com/article?q=%E5%86%99%E4%BD%9C&Refer=user_article&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":
    3. ["info"],"selector":"h3 a","multiple":false,"delay":0},{"id":"author","type":"SelectorText","parentSelectors":
    4. ["info"],"selector":"span a[suda-data]","multiple":false,"regex":"","delay":0},{"id":"following","type":"SelectorText","parentSelectors":
    5. ["info"],"selector":"a[action-type='web_share']","multiple":false,"regex":"","delay":0},{"id":"likes","type":"SelectorText","parentSelectors":
    6. ["info"],"selector":"a span","multiple":false,"regex":"","delay":0},{"id":"time","type":"SelectorText","parentSelectors":
    7. ["info"],"selector":"span: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)开始抓取