Skip to content

Instantly share code, notes, and snippets.

@devasheeshG
Last active July 30, 2025 15:51
Show Gist options
  • Save devasheeshG/ca31007d0cad63480625d28b5f34be23 to your computer and use it in GitHub Desktop.
Save devasheeshG/ca31007d0cad63480625d28b5f34be23 to your computer and use it in GitHub Desktop.
Click a button recursively.
function clickShowMoreButton() {
const classId = '';
const button = document.querySelector(classId);
if (button) {
button.click();
console.log("button clicked");
setTimeout(clickShowMoreButton, 1000); // Wait a second before next click
} else {
console.log("No more buttons to click.");
}
}
clickShowMoreButton();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment