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
I've been trying to write my own logic to skip duplicates and was wondering if there was a possible way to abort requests at the preRequest stage.
varc=newCrawler({preRequest: function(options,done){if(crawledURLs.includes(options.uri)){// Abort the request?}else{// Continue with the request.returndone();}},callback: function(err,res,done){if(err){console.log(err)}else{console.log(res.statusCode)}}});
The text was updated successfully, but these errors were encountered:
Please do not do it in preRequest stage, because you'll be confused with requests rate. reRequest is the last stage before actual requesting. I think you should remove it when queuing new tasks, and suggest you to use seenreq module to simplify the code.
I've been trying to write my own logic to skip duplicates and was wondering if there was a possible way to abort requests at the preRequest stage.
The text was updated successfully, but these errors were encountered: