Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Seluj78/ec7f0f3dd8681631021982714ec9a8c7 to your computer and use it in GitHub Desktop.
Save Seluj78/ec7f0f3dd8681631021982714ec9a8c7 to your computer and use it in GitHub Desktop.
This script will select all `delete` checkbox for mail requests in mailman2
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