Created
December 17, 2024 16:24
-
-
Save tomesparon/dd2b2e516bf04b919ffdf7483f81abd6 to your computer and use it in GitHub Desktop.
Click next on a page with nextpages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Function to click the "Next" button | |
function clickNextPage() { | |
var nextButton = document.getElementById("nextpage"); // Adjust this to match the actual ID or method to find the button | |
if (nextButton) { | |
nextButton.click(); | |
} else { | |
console.log("Next button not found"); | |
} | |
} | |
// Click the "Next" button 60 times with a delay | |
let clicks = 60; | |
let delay = 2000; // 2 seconds delay | |
function automateClicks(clicks) { | |
if (clicks > 0) { | |
clickNextPage(); | |
setTimeout(() => automateClicks(clicks - 1), delay); | |
} | |
} | |
setTimeout(() => automateClicks(clicks), 3000); // Initial 3 seconds delay |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment