You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varCrawler=require("crawler");varurl=require('url');varc=newCrawler({maxConnections : 10,jQuery: 'cheerio',// This will be called for each crawled pagecallback : function(error,result,$){// $ is Cheerio by default//a lean implementation of core jQuery designed specifically for the server$('a').each(function(index,a){vartoQueueUrl=$(a).attr('href');c.queue(toQueueUrl);});}});// Queue just one URL, with default callbackc.queue('https://news.ycombinator.com/');
and get the error while running
C:\Users\User\Desktop\crawler\node_modules\crawler\lib\crawler.js:34
if ('jquery' in options) {
^
TypeError: Cannot use 'in' operator to search for 'jquery' in undefined
at checkJQueryNaming (C:\Users\User\Desktop\crawler\node_modules\crawler\lib
\crawler.js:34:21)
at Crawler._pushToQueue (C:\Users\User\Desktop\crawler\node_modules\crawler
lib\crawler.js:210:15)
at Crawler.queue (C:\Users\User\Desktop\crawler\node_modules\crawler\lib\cra
wler.js:201:14)
at Object. (C:\Users\User\Desktop\crawler\app.js:13:15)
at exports.each (C:\Users\User\Desktop\crawler\node_modules\crawler\node_mod
ules\cheerio\lib\api\traversing.js:294:24)
at Object.Crawler.callback (C:\Users\User\Desktop\crawler\app.js:11:16)
at Crawler._onInject (C:\Users\User\Desktop\crawler\node_modules\crawler\lib
\crawler.js:473:13)
at C:\Users\User\Desktop\crawler\node_modules\crawler\lib\crawler.js:462:18
at Crawler._inject (C:\Users\User\Desktop\crawler\node_modules\crawler\lib\c
rawler.js:147:9)
at Crawler._onContent (C:\Users\User\Desktop\crawler\node_modules\crawler\li
b\crawler.js:461:14)
I am using Windows 8 with node version 0.10.32
The text was updated successfully, but these errors were encountered:
I just use the sample code
and get the error while running
C:\Users\User\Desktop\crawler\node_modules\crawler\lib\crawler.js:34
if ('jquery' in options) {
^
TypeError: Cannot use 'in' operator to search for 'jquery' in undefined
at checkJQueryNaming (C:\Users\User\Desktop\crawler\node_modules\crawler\lib
\crawler.js:34:21)
at Crawler._pushToQueue (C:\Users\User\Desktop\crawler\node_modules\crawler
lib\crawler.js:210:15)
at Crawler.queue (C:\Users\User\Desktop\crawler\node_modules\crawler\lib\cra
wler.js:201:14)
at Object. (C:\Users\User\Desktop\crawler\app.js:13:15)
at exports.each (C:\Users\User\Desktop\crawler\node_modules\crawler\node_mod
ules\cheerio\lib\api\traversing.js:294:24)
at Object.Crawler.callback (C:\Users\User\Desktop\crawler\app.js:11:16)
at Crawler._onInject (C:\Users\User\Desktop\crawler\node_modules\crawler\lib
\crawler.js:473:13)
at C:\Users\User\Desktop\crawler\node_modules\crawler\lib\crawler.js:462:18
at Crawler._inject (C:\Users\User\Desktop\crawler\node_modules\crawler\lib\c
rawler.js:147:9)
at Crawler._onContent (C:\Users\User\Desktop\crawler\node_modules\crawler\li
b\crawler.js:461:14)
I am using Windows 8 with node version 0.10.32
The text was updated successfully, but these errors were encountered: