Skip to content

Instantly share code, notes, and snippets.

@danwarfel
Last active August 6, 2016 13:28
Show Gist options
  • Save danwarfel/291b7fd903453c41507c to your computer and use it in GitHub Desktop.
Save danwarfel/291b7fd903453c41507c to your computer and use it in GitHub Desktop.
Click Each Element // A script to click each element on a page
// 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