From 20810aa85b28a4153923bb5eac8c0e0e811fe899 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Tue, 6 Aug 2024 23:20:10 +0530 Subject: [PATCH] feat: handle scrapeList in WAW actions --- maxun-core/src/interpret.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maxun-core/src/interpret.ts b/maxun-core/src/interpret.ts index d624f930..506c7bd7 100644 --- a/maxun-core/src/interpret.ts +++ b/maxun-core/src/interpret.ts @@ -291,6 +291,12 @@ export default class Interpreter extends EventEmitter { await this.options.serializableCallback(scrapeResult); }, + scrapeList: async (config: { listSelector: string, fields: any, limit?: number, flexible?: boolean }) => { + await this.ensureScriptsLoaded(page); + const scrapeResults: Record[] = await page.evaluate((cfg) => window.scrapeList(cfg), config); + await this.options.serializableCallback(scrapeResults); + }, + scroll: async (pages?: number) => { await page.evaluate(async (pagesInternal) => { for (let i = 1; i <= (pagesInternal ?? 1); i += 1) {