var needDelDeled =true,delay =1000,scrolls =800;var w ='', d ='', r =0;functiongetLuckyDraw(){w.css("background-color","#f1c40f");w = w.parents(".card");w.css("background-color","#2ecc71");w[w.length -1].querySelectorAll(".child-button")[1].click();setTimeout(clickDel, delay);}functiongetDel(){d.css("background-color","#8e44ad");d = d.parents(".card");d.css("background-color","#2ecc71");d[d.length -1].querySelectorAll(".child-button")[1].click();setTimeout(clickDel, delay);}functionclickDel(){//點刪除$(".popup-content-ctnr")[$(".popup-content-ctnr").length -2].querySelector(".bl-button").click();// 點確定r += scrolls;$('html, body').animate({scrollTop: r },30);$(".fold-text").click()$(".expand-btn").click();w =$(".main-content").find('span[click-title="抽獎詳情"]');d =$(".main-content").find('.deleted-text');if(d.length && needDelDeled)setTimeout(getDel, delay);elsesetTimeout(getLuckyDraw, delay);}if(/dynamic/.test(window.location.href)&&confirm("是不是要刪除抽獎動態")){r += scrolls;$('html, body').animate({scrollTop: r },30);$(".fold-text").click()$(".expand-btn").click();w =$(".main-content").find('span[click-title="抽獎詳情"]');//*互動抽獎內容定位d =$(".main-content").find('.deleted-text');//*已刪除內容定位if(d.length && needDelDeled)setTimeout(getDel, delay);elsesetTimeout(getLuckyDraw, delay);}
會彈出是否刪除抽獎動態頁面,選擇確定,則會自動進行刪除,只要耐心等待刪除過程就可以了。
【注】如果火狐或谷歌瀏覽器都無法刪除,換edge或360瀏覽器試試!
【補充】:來自 @jgfdvhtdc
var x =30;//需要刪除的條數var y =10;//從第幾條開始刪除,第一條是0,第十條是9以此類推var interval =setInterval(function(){if(x >0){$("[data-type='THREE_POINT_DELETE']")[y].click();var del =setInterval(function(){$("[class='bili-modal__button confirm']")[0].click();clearInterval(del);},1000);console.log("times:"+ x);x--;}else{clearInterval(interval);console.log("done!")}},3000);