Last active
January 12, 2018 19:11
-
-
Save tuffacton/433a0e122ca019d4794a8ce22847df1b to your computer and use it in GitHub Desktop.
Using dev console, click all elements of a given class on a page. Very useful for grocery store rewards pages where you can click on hundreds of coupons.
This file contains 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
// Create function | |
function waitScrape(class_name) | |
{ | |
console.log("Starting"); | |
var buttons = document.getElementsByClassName(class_name); | |
for(i = 0; i <= buttons.length; i++) { | |
setTimeout(function () { | |
// register click event | |
buttons[i].click(); | |
// Set wait time for 3 seconds (3000 milliseconds) | |
}, 3000); | |
} | |
} | |
// Initiate function | |
waitsScrape('UnFollowUser'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Implemented timer, need to see if I can simulate a "page down" event in order to load all coupons.