笔趣阁 > 其他小说 > 啦啦啦 > 实用技巧

实用技巧

    如何快速取消关注b站up主

    该方法来自@紫薯妹妹爱奶油

    操作步骤:

    点击关注,并翻到最后一页,打开开发者模式F12以及在控制台粘贴下面代码。

    若遇到警告不许粘贴不明代码的时候,可以控制台输入allow pasting 并且再次粘贴代码即可。

    代码如下:

    function startUnfollowProcess(nextButtonName) {

    function unfollowUsers() {

    const btns = document.querySelectorAll('.gray');

    console.log(`找到 ${btns.length} 个已关注按钮`);

    if (btns.length === 0) {

    console.log("没有可取消的用户,停止执行");

    return; // 直接停止,不再翻页

    }

    btns.forEach((btn, index) => {

    setTimeout(() => {

    btn.click();

    console.log(`已取消关注UP主 ${index + 1}`);

    if (index === btns.length - 1) setTimeout(goToNextPage, 1000); // 最后一个取消后翻页

    }, index * 1000);

    });

    }

    function goToNextPage() {

    const nextButton = [...document.querySelectorAll('BUTTON')].find(el => el.textContent.includes(nextButtonName));

    if (nextButton) {

    nextButton.click();

    console.log(`点击了“${nextButtonName}”,继续取消关注`);

    setTimeout(unfollowUsers, 3000); // 翻页后等待加载

    } else {

    console.log("没有上一页,操作完成");

    }

    }

    unfollowUsers(); // 开始执行

    }

    // **调用函数**

    startUnfollowProcess("上一页");

新书推荐: 在星际战场贴小广告 末世囤货求生日常 墨痕噬骨 我以诗文寄日暮 · 上 存档旧文 恶鬼的低语 重回2003和早死的他恋爱 他不是人?我是真狗 贪恋星夜 错位暗恋