How can I use node-crawler with JSDOM?
kerolloz opened this issue · comments
Kerollos Magdy commented
The documentation doesn't mention the way of using jsdom with jquery. Is it injected in the result parameter passed to the callback function like cheerio in $
.
Yinghan Ma commented
const Crawler = require("crawler");
const jsdom = require('jsdom');
const cl = new Crawler({
jQuery: jsdom,
maxConnections : 100,
callback : function (err, res, done) {
const $ = res.$;
const urls = $('#list a');
console.log(urls)
}
});