Created
September 28, 2020 06:38
-
-
Save Seluj78/ec7f0f3dd8681631021982714ec9a8c7 to your computer and use it in GitHub Desktop.
This script will select all `delete` checkbox for mail requests in mailman2
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
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++) { | |
xpath1 = parse('/html/body/form/table/tbody/tr[%s]/td/table/tbody/tr[2]/td[1]/table/tbody/tr[2]/td/table/tbody/tr[2]/td[4]/center/input', i) | |
xpath2 = parse('/html/body/form/table/tbody/tr[%s]/td/table/tbody/tr[2]/td[1]/table/tbody/tr[6]/td/label', i) | |
getElementByXpath(xpath1).click() | |
getElementByXpath(xpath2).click() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment