joshfire/node-crawler — Issue #17: No access to jQuery
Author: beezee
Created: 2011-12-21 16:23:27+00:00
State: open

Running the tests, I'm able to see the full html of the response in result.content, but any attempts to access via jQuery return nothing (no errors, etc.) if (jQuery) console.log('loaded') is not triggered either.

Here's the code with several diff variations on my attempts to access via jQuery-

var Crawler = require("../lib/crawler").Crawler,
c = new Crawler({
"maxConnections":10,
"timeout":120*1000, // seconds
"debug":false,
"callback":function(error,result,$) {
console.log("Got page");
//console.log(result.content);
//if (jQuery) console.log('loaded') ;
//response = $('

' + result.content + '

');
console.log($('title', jQuery(result.content)).text());
//console.log(result.content);
console.log($('meta[name=title]'), response);
/*
$("a").each(function(i,a) {
console.log(this.href);
console.log('got a link');
//c.queue(a.href);
})*/
}
});

c.queue(["http://urbanthesaur.us"]);