如何批量删除企业邮箱邮件

in with 0 comment

如何批量删除企业邮箱邮件

打开控制台

function loopAndClick(times) {
  let count = 0;
  // 设置一个定时器,每 1000 毫秒(1 秒)执行一次
  const intervalId = setInterval(() => {
    // 检查执行次数是否达到指定值
    if (count < times) {
      console.log(`执行第 ${count + 1} 次点击操作...`);
      // 获取到 iframe 的 window 对象
      const iframeWindow = document.getElementById('mainFrame').contentWindow;
      
      // 在 iframe 的上下文中执行代码
      if (iframeWindow && iframeWindow.document) {
        // 选中并点击第一个元素
        const element1 = iframeWindow.document.querySelector('[data-csp-7a5941daef6042b494777d09dd7a4840]');
        if (element1) {
          element1.click();
        }

        // 选中并点击第二个元素
        const element2 = iframeWindow.document.querySelector('[data-csp-3696410354cb432999078f56aa49dfdb-down]');
        if (element2) {
          element2.click();
        }
      } else {
        console.error('无法访问 iframe 文档,请确保 iframe 已加载。');
      }

      count++;
    } else {
      // 达到指定次数后,清除定时器,停止循环
      clearInterval(intervalId);
      console.log(`循环已完成,总共执行了 ${times} 次。`);
    }
  }, 3000); // 1000 毫秒 = 1 秒
}

loopAndClick(100)

当然你可以修改 3000, 速度频率慢一点.然后这个网页一直放在这里就行,他会一直运行

效果

图片描述...

Responses