评论数
结果示例图:
模板:
{"_id":"csdn-article-list","startUrl":
["https://blog.csdn.net/zll_0405/article/list/[1-5]"],"selectors":[{"id":"info","type":"SelectorElement","parentSelectors":
["_root"],"selector":"div.article-item-box","multiple":true,"delay":0},{"id":"title","type":"SelectorLink","parentSelectors":
["info"],"selector":"h4 a","multiple":false,"delay":0},{"id":"time","type":"SelectorText","parentSelectors":["info"],"selector":"span.date","multiple":false,"regex":"","delay":0},{"id":"reads","type":"SelectorText","parentSelectors":
["info"],"selector":"p:nth-of-type(3) span.num","multiple":false,"regex":"","delay":0},{"id":"comments","type":"SelectorText","parentSelectors":
["info"],"selector":"p:nth-of-type(5) span.num","multiple":false,"regex":"","delay":0}]}
模板套用步骤:
(1)进入需要抓取的文章列表页面,例如:https://blog.csdn.net/zll_0405/article/list/1
(2)导入模板
(3)替换 Start URL为要抓取的网页链接,(抓取多页需修改 Start URL 里的页码数)
(4)开始抓取