Skip to content

Instantly share code, notes, and snippets.

@LeiHao0
Created June 13, 2019 21:52
Show Gist options
  • Save LeiHao0/b571d09be5b5985e1b59c5ecb2980ecb to your computer and use it in GitHub Desktop.
Save LeiHao0/b571d09be5b5985e1b59c5ecb2980ecb to your computer and use it in GitHub Desktop.
DeleteZhihu
function findBtn(text) {
var buttons = document.querySelectorAll("button");
btns = [];
for (var i = 0, l = buttons.length; i < l; i++) {
if (buttons[i].lastChild.nodeValue == text) btns.push(buttons[i]);
}
return btns;
}
a = findBtn("设置");
for (i in a) {
a[i].click();
b = findBtn("删除");
for (j in b) {
b[j].click();
}
}
setTimeout(() => {
c = findBtn("确认");
for (k in c) {
c[k].click();
}
window.location.reload();
}, 3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment