Created
September 22, 2020 17:41
-
-
Save Seluj78/9d06c429a0a9623fb986965f7f05e210 to your computer and use it in GitHub Desktop.
This script will select all `delete` checkbox for subsciption requests in mailman2
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
function parse(str) { | |
var args = [].slice.call(arguments, 1), | |
i = 0; | |
return str.replace(/%s/g, () => args[i++]); | |
} | |
function getElementByXpath(path) { | |
return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; | |
} | |
var i; | |
for (i = 2; i < 999 ; i++) { | |
xpath = parse('/html/body/form/table/tbody/tr[%s]/td[2]/table/tbody/tr/td[4]/label/input', i) | |
console.log(xpath) | |
getElementByXpath(xpath).click() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment