补一句,百家号真恶心!
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function executeTasks() {
while (1==1){
await sleep(5000);
const mouseOverEvent = new MouseEvent('mouseover', {
bubbles: true,
cancelable: true,
view: window
});
let dom = document.querySelectorAll('.client_pages_content_v2_components_data2action_actions_withDropDown ')[0];
dom.dispatchEvent(mouseOverEvent);
await sleep(1000);
let btn1 = document.querySelectorAll('.client_pages_content_v2_components_data2action_actions_withdraw');
let btn2 = document.querySelectorAll('.client_pages_content_v2_components_data2action_actions_delete');
if (btn1.length != 0) {
btn1[0].click();
} else if (btn2.length != 0) {
btn2[0].click();
}
await sleep(1500);
document.querySelectorAll('.cheetah-btn-solid')[0].click();
}
}
// 开始执行任务
executeTasks();
标签:批量,删除,querySelectorAll,百家,content,sleep,actions,document,click
From: https://www.cnblogs.com/lambertlt/p/18570439