Skip to content

Instantly share code, notes, and snippets.

@tomesparon
Created December 17, 2024 16:24
Show Gist options
  • Save tomesparon/dd2b2e516bf04b919ffdf7483f81abd6 to your computer and use it in GitHub Desktop.
Save tomesparon/dd2b2e516bf04b919ffdf7483f81abd6 to your computer and use it in GitHub Desktop.
Click next on a page with nextpages
// 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