抖音批量清空关注列表代码
电脑端网页登录抖音,打开关注列表,调出控制台,粘贴以下代码:
互相关注不会取消
代码具有时效性,2026-08-10 测试可用。
(function () {
'use strict';
let processedCount = 0;
let errorCount = 0;
const intervalMs = 200;
async function runBatch() {
// 列表上的按钮文本是「已关注」,点击唤起确认弹窗
const followBtns = Array.from(document.querySelectorAll('button')).filter(el => {
const t = el.textContent?.trim();
return t === '已关注' && !el.disabled;
});
if (followBtns.length === 0) {
console.log(`✅本轮结束。已处理:${processedCount},失败:${errorCount}`);
console.log('👉无更多[已关注]按钮,滚动加载更多后重新运行脚本');
return;
}
console.log(`🔍找到${followBtns.length}个[已关注],开始处理`);
for (const btn of followBtns) {
try {
btn.click();
// await new Promise(r => setTimeout(r, 600));
// // 在弹窗中寻找确认取消按钮
// const confirmBtn = Array.from(document.querySelectorAll('button')).find(b => {
// return b.textContent?.trim() === '取消';
// });
// if (confirmBtn) {
// confirmBtn.click();
// processedCount++;
// console.log(`✔已取消,累计:${processedCount}`);
// } else {
// console.warn('⚠未找到弹窗确认按钮,跳过');
// }
} catch (err) {
errorCount++;
console.error(`❌操作失败`, err);
}
await new Promise(resolve => setTimeout(resolve, intervalMs));
}
setTimeout(runBatch, 2000);
}
console.log('🚀抖音批量取关脚本启动');
runBatch();
})();等待即可。
评论 (0)