diff --git a/app/crawler/specificCrawlers/olx.js b/app/crawler/specificCrawlers/olx.js index 44ce679..e2a0492 100644 --- a/app/crawler/specificCrawlers/olx.js +++ b/app/crawler/specificCrawlers/olx.js @@ -228,16 +228,18 @@ class OlxCrawler { } + const hamo = [] const { scrapedData, errors } = await PromisePool .withConcurrency(2) .for(asyncScraping) .process(async data => { const result = await this.scrapeAd(data) await this.sleep(this.delayBetweenPages); - return result; + hamo.push(result) + return result; //TODO: this does not work, scrapedData is null, hamo works }) - const filteredScrapedData = scrapedData.filter(adData => !!adData); + const filteredScrapedData = hamo.filter(adData => !!adData); return filteredScrapedData; } catch (e) { console.error("Exception caught:" + e);