Created
April 24, 2017 17:43
-
-
Save hcientist/9fa5de57d816b5cc636520e76199be7e to your computer and use it in GitHub Desktop.
tries to click all elements on a page with the class 'load-more-button' (useful to fully "hydrate" a youtube page)
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
javascript:(function(){var noMoreCt = 0; var loadMoreInterval = window.setInterval(function () {var btns = document.getElementsByClassName('load-more-button'); if (btns.length > 0) {Array.prototype.forEach.call(btns,function (btn){btn.click();console.log('clicked');});} else {if(noMoreCt >=4) {window.clearInterval(loadMoreInterval);} else {noMoreCt++;}}}, 250);})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment