feat: add pagination param

This commit is contained in:
karishmas6
2024-08-13 23:56:27 +05:30
parent 448ffbfc05
commit 375590fc0d

View File

@@ -278,7 +278,7 @@ async function scrollDownToLoadMore(selector, limit) {
* @param {boolean} [config.flexible=false] - Whether to use flexible matching for field selectors * @param {boolean} [config.flexible=false] - Whether to use flexible matching for field selectors
* @returns {Array.<Array.<Object>>} Array of arrays of scraped items, one sub-array per list * @returns {Array.<Array.<Object>>} Array of arrays of scraped items, one sub-array per list
*/ */
window.scrapeList = function ({ listSelector, fields, limit = 10 }) { window.scrapeList = function ({ listSelector, fields, limit = 10, pagination }) {
// Get all parent elements matching the listSelector // Get all parent elements matching the listSelector
const parentElements = Array.from(document.querySelectorAll(listSelector)).slice(0, limit); const parentElements = Array.from(document.querySelectorAll(listSelector)).slice(0, limit);