Skip to content

Commit

Permalink
fix(Lidl_cz BF): topmonks#2654 - lidl.cz - replace sleep() with new P…
Browse files Browse the repository at this point in the history
…romise
  • Loading branch information
oleksandravalko committed Nov 28, 2024
1 parent f7ff13a commit a895aea
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions actors/lidl-daily/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { setTimeout as sleep } from "node:timers/promises";
import { HttpCrawler } from "@crawlee/http";
import { PlaywrightCrawler } from "@crawlee/playwright";
import { ActorType } from "@hlidac-shopu/actors-common/actor-type.js";
Expand Down Expand Up @@ -328,11 +327,11 @@ async function loadLazyContent({ page }) {
window.scrollTo(0, scrolledBy);
if (scrolledBy >= document.body.scrollHeight) break;
scrollCount += 1;
await sleep(250);
await new Promise(resolve => setTimeout(resolve, 250));
}
});

await sleep(1000);
await new Promise(resolve => setTimeout(resolve, 1000));
await page.waitForLoadState("networkidle");
}

Expand Down

0 comments on commit a895aea

Please sign in to comment.