feat: remove redundant scraping outside switch case

This commit is contained in:
karishmas6
2024-08-20 22:01:29 +05:30
parent 8857de0b8f
commit 24a3dd9a97

View File

@@ -441,13 +441,6 @@ export default class Interpreter extends EventEmitter {
return allResults;
}
// Wait a bit before next iteration to ensure content is loaded
await page.waitForTimeout(1000);
// Scrape the current page after scrolling/clicking
const pageResults = await page.evaluate((cfg) => window.scrapeList(cfg), config);
allResults = allResults.concat(pageResults);
if (config.limit && allResults.length >= config.limit) {
allResults = allResults.slice(0, config.limit);
break;