Preparing to save results to db
This commit is contained in:
@@ -110,8 +110,6 @@ module.exports = class OlxCrawler {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
async indexPage(url, maxResults = 1000) {
|
||||
try {
|
||||
// console.log('Starting to index page: ' + pageNr);
|
||||
@@ -138,7 +136,7 @@ module.exports = class OlxCrawler {
|
||||
if (singleData) {
|
||||
results.push(singleData);
|
||||
}
|
||||
await this.sleep(500);
|
||||
// await this.sleep(500);
|
||||
}
|
||||
|
||||
return results;
|
||||
@@ -177,7 +175,7 @@ module.exports = class OlxCrawler {
|
||||
let result = await this.indexPage(url, maxResults);
|
||||
// Object.assign(results, result)
|
||||
results.push(result);
|
||||
await this.sleep(5000);
|
||||
// await this.sleep(5000);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user