From ffa992f1862bf6df095715c728b10e16989b8375 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Tue, 6 Aug 2024 23:15:12 +0530 Subject: [PATCH] feat: pass scrapeList to ensureScriptsLoaded --- maxun-core/src/interpret.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/maxun-core/src/interpret.ts b/maxun-core/src/interpret.ts index 4860d2fd..d624f930 100644 --- a/maxun-core/src/interpret.ts +++ b/maxun-core/src/interpret.ts @@ -29,6 +29,7 @@ interface InterpreterOptions { }> } + /** * Class for running the Smart Workflows. */ @@ -410,7 +411,7 @@ export default class Interpreter extends EventEmitter { } private async ensureScriptsLoaded(page: Page) { - const isScriptLoaded = await page.evaluate(() => typeof window.scrape === 'function' && typeof window.scrapeSchema === 'function'); + const isScriptLoaded = await page.evaluate(() => typeof window.scrape === 'function' && typeof window.scrapeSchema === 'function' && typeof window.scrapeList === 'function'); if (!isScriptLoaded) { await page.addInitScript({ path: path.join(__dirname, 'browserSide', 'scraper.js') }); }