评论数
结果示例图:
![image (2).png](/uploads/projects/liqiaolin-nqusg@lazdsm/1736d5a4850eba2999c3b08bceb883b8.png)
模板:{"_id":"zhangjiawei2","startUrl":["https://www.zhihu.com/people/zhang-jia-wei/posts?page=[1-5]"],"selectors":
[{"id":"info","type":"SelectorElement","parentSelectors":
["_root"],"selector":"div.List-item","multiple":true,"delay":0},{"id":"title","type":"SelectorLink","parentSelectors":
["info"],"selector":"h2 a","multiple":false,"delay":0},{"id":"likes","type":"SelectorText","parentSelectors":["info"],"selector":"button.VoteButton--up","multiple":false,"regex":"","delay":0},{"id":"comments","type":"SelectorText","parentSelectors":["info"],"selector":"button.ContentItem-action:nth-of-type(1)","multiple":false,"regex":"","delay":0}]}
模板套用步骤:
(1)进入大V文章页面,例如:https://www.zhihu.com/people/zhang-jia-wei/posts
(2)导入模板
(3)替换 Start URL为要抓取的网页链接,修改要抓取的页数,比如:”[1-5]“是 第 1 页到第 5 页所有文章。
(4)开始抓取