无需下载软件和收费,解决软著当前提交人数过多,系统繁忙,请稍后重新提交

第一步:打开到这个界面(待提交)

第二步:在第一部的界面按F12,选择控制台

将代码粘贴进去:

class SoftCopyAutoSubmitter {
    constructor() {
        this.intervalTime = 1000; // 整体循环间隔1秒
        this.maxRetries = 10000; // 最大重试次数
        this.currentRetry = 0;  // 当前重试次数
        this.successUrlPattern = '/opus/success';
        this.isRunning = false;
        this.confirmSelector = 'body > div.carousel.carouselFixed > div > div > div.hd-msg-box-footer > button.hd-btn.blue.medium';
    }

    getElementByText(tag, text) {
        const elements = document.querySelectorAll(tag);
        for (let el of elements) {
            if (el.textContent.includes(text)) {
                return el;
            }
        }
        return null;
    }

    getMainSubmitButton() {
        let btn = this.getElementByText('button', '确认提交');
        if (!btn) btn = this.getElementByText('span', '提交');
        return btn;
    }

    getConfirmButton() {
        const btn = document.querySelector(this.confirmSelector);
        return btn;
    }

    checkForError() {
        const bodyCheck = document.body.innerText.includes('当前提交人数过多');
        return bodyCheck;
    }

    checkSuccess() {
        return window.location.href.includes(this.successUrlPattern);
    }

    sleep(ms) {
        return new Promise(resolve => setTimeout(resolve, ms));
    }

    async start() {
        if (this.isRunning) return;
        this.isRunning = true;
        console.log("自动化提交脚本(双重确认版)已启动...");

        while (this.currentRetry < this.maxRetries) {
            console.log(`\n------ 第 ${this.currentRetry + 1} 次尝试 ------`);

            if (this.checkSuccess()) {
                console.log("恭喜!检测到提交成功,脚本停止。");
                break;
            }

            const mainBtn = this.getMainSubmitButton();
            if (mainBtn) {
                console.log("点击主提交按钮...");
                mainBtn.click();
                
                await this.sleep(1000); 

                const confirmBtn = this.getConfirmButton();
                if (confirmBtn) {
                     console.log("发现确认弹窗,点击确认按钮...");
                     confirmBtn.click();
                } else {
                     console.warn("点击主按钮后未发现确认弹窗 (可能是还未加载或已被点击)");
                }
            } else {
                console.log("无法找到主提交按钮");
            }

            await this.sleep(2000);

            if (this.checkForError()) {
                console.log(`提示"人数过多",将在 ${this.intervalTime / 1000} 秒后重试...`);
            } else {
                console.log("未检测到错误,继续轮询...");
            }

            await this.sleep(this.intervalTime);
            this.currentRetry++;
        }

        if (this.currentRetry >= this.maxRetries) {
            console.log("达到最大重试次数,脚本停止。");
        }
        this.isRunning = false;
    }
}

const submitter = new SoftCopyAutoSubmitter();
submitter.start();

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值