From ac8dcf685782f5d1b5ea873e0a33d3c81c8be5de Mon Sep 17 00:00:00 2001 From: Rohit Date: Sat, 7 Jun 2025 14:23:32 +0530 Subject: [PATCH] feat: increment and add list results --- maxun-core/src/interpret.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/maxun-core/src/interpret.ts b/maxun-core/src/interpret.ts index 19b97707..b51652b1 100644 --- a/maxun-core/src/interpret.ts +++ b/maxun-core/src/interpret.ts @@ -47,6 +47,7 @@ interface InterpreterOptions { activeId: (id: number) => void, debugMessage: (msg: string) => void, setActionType: (type: string) => void, + incrementScrapeListIndex: () => void, }> } @@ -475,6 +476,11 @@ export default class Interpreter extends EventEmitter { } await this.ensureScriptsLoaded(page); + + if (this.options.debugChannel?.incrementScrapeListIndex) { + this.options.debugChannel.incrementScrapeListIndex(); + } + if (!config.pagination) { const scrapeResults: Record[] = await page.evaluate((cfg) => window.scrapeList(cfg), config); await this.options.serializableCallback(scrapeResults); @@ -624,6 +630,8 @@ export default class Interpreter extends EventEmitter { }); allResults = allResults.concat(newResults); debugLog("Results collected:", allResults.length); + + await this.options.serializableCallback(allResults); }; const checkLimit = () => {