Changed delay between ads.

This commit is contained in:
Naida Vatric
2020-03-01 00:44:48 +01:00
parent e1651306eb
commit ccea5fe2aa
4 changed files with 35 additions and 4 deletions

View File

@@ -217,6 +217,8 @@ class OlxCrawler {
//let numberOfParseErrors = 0;
// do {
try {
await this.sleep(this.delayBetweenAds);
const adPageSource = await fetch(url);
const body = await adPageSource.text();
const $ = cheerio.load(body);
@@ -694,6 +696,8 @@ class OlxCrawler {
console.error("Exception caught: " + e.message, "\r\nURL:", url);
}
// } while (hasParseErrors && numberOfParseErrors <= 1);
await this.sleep(this.delayBetweenAds);
return null;
}