diff --git a/maxun-core/src/browserSide/scraper.js b/maxun-core/src/browserSide/scraper.js index 244613f5..24e8f651 100644 --- a/maxun-core/src/browserSide/scraper.js +++ b/maxun-core/src/browserSide/scraper.js @@ -278,9 +278,9 @@ async function scrollDownToLoadMore(selector, limit) { * @param {boolean} [config.flexible=false] - Whether to use flexible matching for field selectors * @returns {Array.>} Array of arrays of scraped items, one sub-array per list */ - window.scrapeList = function ({ listSelector, fields }) { + window.scrapeList = function ({ listSelector, fields, limit = 10 }) { // Get all parent elements matching the listSelector - const parentElements = Array.from(document.querySelectorAll(listSelector)); + const parentElements = Array.from(document.querySelectorAll(listSelector)).slice(0, limit); const scrapedData = [];