From 5d1747c874f505a4bc08c077cc965e078c60470c Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sun, 18 Aug 2024 22:35:35 +0530 Subject: [PATCH] feat: wait before next iteration for content load completion --- maxun-core/src/interpret.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/maxun-core/src/interpret.ts b/maxun-core/src/interpret.ts index 5e4551a4..f0111ccf 100644 --- a/maxun-core/src/interpret.ts +++ b/maxun-core/src/interpret.ts @@ -421,6 +421,9 @@ export default class Interpreter extends EventEmitter { return allResults; } + // Wait a bit before next iteration to ensure content is loaded + await page.waitForTimeout(1000); + // Check if new items were loaded const newItemsLoaded = await page.evaluate((prevCount, listSelector) => { const currentCount = document.querySelectorAll(listSelector).length;