Skip to content

Commit fd7d0df

Browse files
authored
Merge pull request #684 from getmaxun/allow-duplicates
feat(maxun-core): remove max duplicate item logic
2 parents 6c2e2d7 + cfd3c17 commit fd7d0df

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

maxun-core/src/interpret.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -950,9 +950,9 @@ export default class Interpreter extends EventEmitter {
950950
if (checkLimit()) return allResults;
951951

952952
let loadMoreCounter = 0;
953-
let previousResultCount = allResults.length;
954-
let noNewItemsCounter = 0;
955-
const MAX_NO_NEW_ITEMS = 2;
953+
// let previousResultCount = allResults.length;
954+
// let noNewItemsCounter = 0;
955+
// const MAX_NO_NEW_ITEMS = 2;
956956

957957
while (true) {
958958
// Find working button with retry mechanism
@@ -1019,21 +1019,21 @@ export default class Interpreter extends EventEmitter {
10191019

10201020
await scrapeCurrentPage();
10211021

1022-
const currentResultCount = allResults.length;
1023-
const newItemsAdded = currentResultCount > previousResultCount;
1022+
// const currentResultCount = allResults.length;
1023+
// const newItemsAdded = currentResultCount > previousResultCount;
10241024

1025-
if (!newItemsAdded) {
1026-
noNewItemsCounter++;
1027-
debugLog(`No new items added after click (${noNewItemsCounter}/${MAX_NO_NEW_ITEMS})`);
1025+
// if (!newItemsAdded) {
1026+
// noNewItemsCounter++;
1027+
// debugLog(`No new items added after click (${noNewItemsCounter}/${MAX_NO_NEW_ITEMS})`);
10281028

1029-
if (noNewItemsCounter >= MAX_NO_NEW_ITEMS) {
1030-
debugLog(`Stopping after ${MAX_NO_NEW_ITEMS} clicks with no new items`);
1031-
return allResults;
1032-
}
1033-
} else {
1034-
noNewItemsCounter = 0;
1035-
previousResultCount = currentResultCount;
1036-
}
1029+
// if (noNewItemsCounter >= MAX_NO_NEW_ITEMS) {
1030+
// debugLog(`Stopping after ${MAX_NO_NEW_ITEMS} clicks with no new items`);
1031+
// return allResults;
1032+
// }
1033+
// } else {
1034+
// noNewItemsCounter = 0;
1035+
// previousResultCount = currentResultCount;
1036+
// }
10371037

10381038
if (checkLimit()) return allResults;
10391039

0 commit comments

Comments
 (0)