Last active
August 6, 2016 13:28
-
-
Save danwarfel/291b7fd903453c41507c to your computer and use it in GitHub Desktop.
Click Each Element
// A script to click each element on a 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
// A script to click each element on a page | |
list = document.getElementsByClassName('sc-button-download') | |
[].forEach.call(list, function(el) { | |
var evt = document.createEvent("MouseEvents") | |
evt.initMouseEvent("click", true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null) | |
el.dispatchEvent(evt) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment