Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Seluj78/9d06c429a0a9623fb986965f7f05e210 to your computer and use it in GitHub Desktop.
Save Seluj78/9d06c429a0a9623fb986965f7f05e210 to your computer and use it in GitHub Desktop.
This script will select all `delete` checkbox for subsciption 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++) {
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