Skip to content

Instantly share code, notes, and snippets.

@andrewshulgin
Created April 27, 2021 17:36
Show Gist options
  • Save andrewshulgin/15dd525fbf37b8d8503405be67fb7895 to your computer and use it in GitHub Desktop.
Save andrewshulgin/15dd525fbf37b8d8503405be67fb7895 to your computer and use it in GitHub Desktop.
function clickWhilePresent() {
let found = false;
for (let btn of document.getElementsByTagName('button')) {
if (btn.innerText == 'View More') {
btn.click();
setTimeout(clickWhilePresent, 500);
found = true;
break;
}
}
if (!found) {
alert('Done!');
}
}
clickWhilePresent();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment