feat: add limit to table scraping

This commit is contained in:
RohitR311
2024-12-26 03:38:40 +05:30
parent 31d9730237
commit fcc71e0841

View File

@@ -407,7 +407,7 @@ function scrapableHeuristics(maxCountPerPage = 50, minArea = 20000, scrolls = 3,
const rows = Array.from(tableContext.getElementsByTagName('TR'));
const processedRows = filterRowsBasedOnTag(rows, tableFields);
for (let rowIndex = 0; rowIndex < processedRows.length; rowIndex++) {
for (let rowIndex = 0; rowIndex < Math.min(processedRows.length, limit); rowIndex++) {
const record = {};
const currentRow = processedRows[rowIndex];