Created
April 27, 2021 17:36
-
-
Save hex128/15dd525fbf37b8d8503405be67fb7895 to your computer and use it in GitHub Desktop.
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 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