评论内容
结果示例图:
模板:
{"_id":"bookcomment","startUrl":["https://book.douban.com/subject/26781120/comments/hot?p=[1-5]"],"selectors":
[{"id":"aaa","type":"SelectorElement","parentSelectors":
["_root"],"selector":"li.comment-item","multiple":true,"delay":"2000"},{"id":"name","type":"SelectorText","parentSelectors":
["aaa"],"selector":".comment-info a","multiple":false,"regex":"","delay":0},{"id":"time","type":"SelectorText","parentSelectors":
["aaa"],"selector":".comment-info span:nth-of-type(2)","multiple":false,"regex":"","delay":0},{"id":"likes","type":"SelectorText","parentSelectors":
["aaa"],"selector":"span.vote-count","multiple":false,"regex":"","delay":0},{"id":"content","type":"SelectorText","parentSelectors":["aaa"],"selector":"span.short","multiple":false,"regex":"","delay":0}]}
模板套用步骤:
(1)进入需要抓取的书籍评论页面,例如:https://book.douban.com/subject/26781120/comments/hot?p=2
(2)导入模板
(3)替换 Start URL为要抓取的网页链接,(抓取多页需修改 Start URL 里的页码数)
(4)开始抓取