Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds a retry mechanism for finding the "Load More" button before exiting the loop. When no "Load More" button is initially found, the code now waits 5 seconds and checks one more time before breaking out of the loop, potentially improving reliability when content loads slowly.
- Introduced a
triedFindingboolean flag to track retry attempts - Modified the logic to wait 5 seconds and retry once when no "Load More" button is found
- Changed immediate break behavior to conditional break after retry attempt
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| break; | ||
| if (!triedFinding) { | ||
| await page.waitForTimeout(5000); | ||
| triedFinding = true; |
There was a problem hiding this comment.
The retry logic should continue the loop after waiting, not just set the flag. Currently, after the 5-second wait and setting triedFinding = true, the loop continues but immediately evaluates findLoadMoreButton again without any indication that the button should now be available. Consider adding continue; after line 149 to make the retry intent explicit.
| triedFinding = true; | |
| triedFinding = true; | |
| continue; |
No description provided.