简介
结果示例图:
模板:
{"_id":"tieba","startUrl":["http://tieba.baidu.com/f?kw=%E8%8B%B9%E6%9E%9C&ie=utf-8&pn=[0-450:50]"],"selectors":
[{"id":"info","type":"SelectorElement","parentSelectors":["_root"],"selector":"li.j_thread_list","multiple":true,"delay":0},{"id":"title","type":"SelectorLink","parentSelectors":["info"],"selector":"div.threadlist_title a","multiple":false,"delay":0},{"id":"reply_num","type":"SelectorText","parentSelectors":["info"],"selector":"span.threadlist_rep_num","multiple":false,"regex":"","delay":0},{"id":"author","type":"SelectorText","parentSelectors":
["info"],"selector":"span.frs-author-name-wrap","multiple":false,"regex":"","delay":0}]}
模板套用步骤:
(1)进入需要抓取的贴吧页面,例如:http://tieba.baidu.com/f?kw=%E8%8B%B9%E6%9E%9C&ie=utf-8&pn=0
(2)导入模板
(3)替换 Start URL为要抓取的网页链接,(抓取多页需修改 Start URL 里的页码数)
(4)开始抓取