抓取的结果信息包含:
- 用户名字
- 评论内容
- 评论时间
- 点赞数
结果示例图:
模板:
{"_id":"youtube-comments","startUrl":["https://www.youtube.com/watch?v=hR4DiU8wcVk"],"selectors":
[{"id":"info","type":"SelectorElementScroll","parentSelectors":
["_root"],"selector":"ytd-comment-thread-renderer","multiple":true,"delay":"2000"},{"id":"user-name","type":"SelectorText","parentSelectors":
["info"],"selector":"div#header-author","multiple":false,"regex":"","delay":0},{"id":"time","type":"SelectorText","parentSelectors":
["info"],"selector":".above-comment a","multiple":false,"regex":"","delay":0},{"id":"content","type":"SelectorText","parentSelectors":
["info"],"selector":"span.yt-formatted-string:nth-of-type(1)","multiple":false,"regex":"","delay":0},{"id":"likes","type":"SelectorText","parentSelectors":
["info"],"selector":"span#vote-count-middle","multiple":false,"regex":"","delay":0}]}
模板套用步骤:
(1)进入需要抓取的视频评论页面,例如:https://www.youtube.com/watch?v=hR4DiU8wcVk
(2)导入模板
(3)替换 Start URL为要抓取的网页链接
(4)开始抓取
(5)弹出窗口后,手动下拉几秒,然后等待抓取完成
小提示:如果数据太多,需要停止抓取,可以断网