Skip to content

Instantly share code, notes, and snippets.

@hcientist
Created April 24, 2017 17:43
Show Gist options
  • Save hcientist/9fa5de57d816b5cc636520e76199be7e to your computer and use it in GitHub Desktop.
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)
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