feat: add limit to table scraping
This commit is contained in:
@@ -407,7 +407,7 @@ function scrapableHeuristics(maxCountPerPage = 50, minArea = 20000, scrolls = 3,
|
|||||||
const rows = Array.from(tableContext.getElementsByTagName('TR'));
|
const rows = Array.from(tableContext.getElementsByTagName('TR'));
|
||||||
const processedRows = filterRowsBasedOnTag(rows, tableFields);
|
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 record = {};
|
||||||
const currentRow = processedRows[rowIndex];
|
const currentRow = processedRows[rowIndex];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user