18-7 喜马拉雅某分类音频信息 - 图1

抓取的结果信息包含:

  • 专辑名字
  • 专辑链接
  • 专辑标签
  • 收听数
  • 价格
  • 更新时间

    结果示例图:

    18-7 喜马拉雅某分类音频信息 - 图2

    模板:

    1. {"_id":"ximalaya-fenlei","startUrl":
    2. ["https://www.ximalaya.com/youshengshu/wenxue/p[1-5]"],"selectors":[{"id":"info","type":"SelectorElement","parentSelectors":
    3. ["_root"],"selector":"div.album-wrapper","multiple":true,"delay":0},{"id":"name","type":"SelectorLink","parentSelectors":
    4. ["info"],"selector":"a.album-title","multiple":false,"delay":0},{"id":"listens","type":"SelectorText","parentSelectors":
    5. ["info"],"selector":"a.album-cover","multiple":false,"regex":"","delay":0},{"id":"tag","type":"SelectorText","parentSelectors":["name"],"selector":"div.tags","multiple":false,"regex":"","delay":0},{"id":"price","type":"SelectorText","parentSelectors":
    6. ["name"],"selector":"div.price-btn","multiple":false,"regex":"","delay":0},
    7. {"id":"update-time","type":"SelectorText","parentSelectors":["name"],"selector":"span.time.lO_","multiple":false,"regex":"","delay":0}]}

    模板套用步骤:

    (1)进入需要抓取的专辑分类页面,例如:https://www.ximalaya.com/youshengshu/wenxue/
    (2)导入模板
    (3)替换 Start URL为要抓取的网页链接,(抓取多页需修改 Start URL 里的页码数)
    (4)开始抓取