From e9f1ff0294c6473338b2a5f830c6e84e1e2ea080 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Fri, 20 Sep 2024 20:19:55 +0530 Subject: [PATCH] feat: remove browser side scroll down --- maxun-core/src/browserSide/scraper.js | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/maxun-core/src/browserSide/scraper.js b/maxun-core/src/browserSide/scraper.js index c5ec54bf..56b91408 100644 --- a/maxun-core/src/browserSide/scraper.js +++ b/maxun-core/src/browserSide/scraper.js @@ -126,25 +126,6 @@ function scrapableHeuristics(maxCountPerPage = 50, minArea = 20000, scrolls = 3, return out; } -async function scrollDownToLoadMore(selector, limit) { - let previousHeight = 0; - let itemsLoaded = 0; - - while (itemsLoaded < limit) { - window.scrollBy(0, window.innerHeight); - await new Promise(resolve => setTimeout(resolve, 1000)); - - const currentHeight = document.body.scrollHeight; - - if (currentHeight === previousHeight) { - break; // No more items to load - } - - previousHeight = currentHeight; - itemsLoaded += document.querySelectorAll(selector).length; - } -} - /** * Returns a "scrape" result from the current page. * @returns {Array} *Curated* array of scraped information (with sparse rows removed)