内容详情
结果示例图:
![image.png](/uploads/projects/liqiaolin-nqusg@lazdsm/00eff494059fa34e1a7d643002886d47.png)
模板:{"_id":"zhihu-answers-and-content","startUrl":
["https://www.zhihu.com/people/zhang-jia-wei/answers?page=[1-5]"],"selectors":[{"id":"answers","type":"SelectorElement","parentSelectors":
["_root"],"selector":"div.List-item","multiple":true,"delay":0},{"id":"title","type":"SelectorLink","parentSelectors":
["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)开始抓取