登录网页版QQ空间,进入说说,打开浏览器开发者工具,一般为F12,然后选择Console,点击最下面,输入以下代码:
var delay = 1000; function del() { document.querySelector('.app_canvas_frame').contentDocument.querySelector('.del_btn').click(); setTimeout("yes()", delay); } function yes() { document.querySelector('.qz_dialog_layer_btn').click(); setTimeout("del()", delay); } del();
不支持自动翻页。
以下支持自动翻页:
(async () => {
let frameDocument = document.querySelector('.app_canvas_frame').contentWindow.document;
while (true) {
frameDocument.querySelectorAll('.del_btn').forEach(item => item.click());
await sleep(1500);
document.querySelectorAll('.qz_dialog_layer_sub').forEach(item => item.click());
await sleep(1500);
nextPage();
await sleep(1000);
}
function nextPage() {
let aTags = frameDocument.querySelector('.mod_pagenav_main>a');
for (let item of aTags) {
if (item.innerText == '下一页') {
item.click();
break;
}
}
}
function sleep(time) {
return new Promise(resolve => setTimeout(resolve, time));
}
})();