如何使用 F12 开发者工具自动批量删除新浪微博

对于发布了太多条微博的人来说手动去翻页删除新浪微博是件很麻烦且很浪费时间的东西,而我今天就体验到了,虽然有插件,但是我没用,不过好在有人分享了一段代码可以自动删除还是比较方便。

这里也是刚好做个记录,对于如果你也刚好需要批量删除微博,有空也可以试试。

这里以 360 安全浏览器为例:

1、登陆新浪微博并来到个人主页界面。

2、按 F12 键切换到开发者工具。

3、拷贝以下代码到 Console(控制台)并按回车就可以执行自动删除微博了。

‘use strict’;
var s = document.createElement(“script”);
s.setAttribute(“src”,”https://lib.sinaapp.com/js/jquery/2.0.3/jquery-2.0.3.min.js”);
s.onload = function(){
for(var i=0;i<100;i++){
setTimeout(function(){
$(‘a[action-type=”fl_menu”]’)[0].click();
$(‘a[title=”删除此条微博”]’)[0].click();
$(‘a[action-type=”ok”]’)[0].click();
},1000*i);
}
}
document.head.appendChild(s);

注意:最好切换到你想删除的页数后再执行(有些人可能会几十上百页)。


以上方法已失效,新方法已更新:

2021年2月更新:

'use strict';
var s = document.createElement('script');
s.setAttribute(
'src',
'https://lib.sinaapp.com/js/jquery/2.0.3/jquery-2.0.3.min.js'
);
s.onload = function() {
setInterval(function() {
if (!$('a[action-type="feed_list_delete"]')) {
$('a.next').click();
} else {
$('a[action-type="feed_list_delete"]')[0].click();
$('a[action-type="ok"]')[0].click();
}
// scroll bottom let auto load
$('html, body').animate({ scrollTop: $(document).height() }, 'slow');
}, 800);
};
document.head.appendChild(s);