function video(categoryList){
console.log(categoryList)
c.queue([{
uri: categoryList,
forceUTF8:true,
// The global callback won’t be called
callback: function (error, res, done) {
var $ = res.$;
var s = $(’#pl-header’).text();
console.log(s);
done();
}
抓取动态内容无非就是构造请求,你可以参考我的这个例子, ,虽然内容不是动态的,但关联页面的id是动态获取的,道理一样。
http://www.nightmarejs.org/
thank you @tower1229 @atian25
看这篇 最简单 https://cnodejs.org/topic/57c529cf9b447b634391c814
正好以前分析某网站营收情况时用过,因为那边没有做反爬,url什么的打了点马赛克。 其实用起来非常简单的,就是 new Crawler({…}); 选项里传递 callback 处理 result, 然后 c.queue(url); 就行了。
@tower1229 @atian25 ok谢谢,我现在先看了一下 网络爬虫与数据库操作,然后去理解两位大神的。
@Jackzhangpan Chrome render 可以满足你的需求 https://github.com/gwuhaolin/chrome-render
@i5ting 请问一下,利用node-crawler爬虫时,如何利用爬下来的第一层数据进入到下一层
@zhoujinhai 数据缓存起来,遍历不就可以了么
@i5ting 不好意思啊,又来问了,第二层我的会报错。 error: CRAWLER Error Error: ETIMEDOUT when fetching https://www.youtube.com/playlist?list=PL3ZQ5CpNulQk8-p0CWo9ufI81IdrGoyNZ