image (25).png

抓取结果信息包含:

  • 回答标题
  • 回答链接
  • 赞同数
  • 评论数
  • 内容详情

    结果示例图:

    image.png
    模板:
    1. {"_id":"zhihu-answers-and-content","startUrl":
    2. ["https://www.zhihu.com/people/zhang-jia-wei/answers?page=[1-5]"],"selectors":[{"id":"answers","type":"SelectorElement","parentSelectors":
    3. ["_root"],"selector":"div.List-item","multiple":true,"delay":0},{"id":"title","type":"SelectorLink","parentSelectors":
    4. ["answers"],"selector":"[itemprop='zhihu:question'] a","multiple":false,"delay":0},{"id":"agrees","type":"SelectorText","parentSelectors":["answers"],"selector":"button.VoteButton--up","multiple":false,"regex":"","delay":0},{"id":"comments","type":"SelectorText","parentSelectors":["answers"],"selector":"button.ContentItem-action:nth-of-type(1)","multiple":false,"regex":"","delay":0},{"id":"content","type":"SelectorText","parentSelectors":["title"],"selector":"div.RichContent-inner","multiple":false,"regex":"","delay":0}]}

    模板套用步骤:

    (1)进入大V回答页面,例如:https://www.zhihu.com/people/zhang-jia-wei/answers
    (2)导入模板
    (3)替换 Start URL为要抓取的网页链接,修改要抓取的页数,比如:”[1-5]“是 第 1 页到第 5 页所有文章。
    (4)开始抓取