吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 2032|回复: 7
收起左侧

[其他原创] 一键审核毕业答辩申请

[复制链接]
liyitong 发表于 2025-5-21 19:37
本帖最后由 liyitong 于 2025-5-22 12:32 编辑

微信截图_20250522085003.png
众所周知,知网的毕业设计管理系统得点太多太多下。
结合
https://www.52pojie.cn/thread-2030433-1-1.html
的帖子,在网页上添加一个button,点击一下就执行点一遍所有目标选择框。该代码在脚本猫上执行无误。
[JavaScript] 纯文本查看 复制代码
// ==UserScript==
//@name       一键审核毕业答辩申请
//@namespace https://www.52pojie.cn/home.php?mod=space&uid=1796855
//@version 1.2
//@description  co2.cnki
//@AuThor    liyitong
//@match     https://co2.cnki.net/Main.html*
//@grant     GM_xmlhttpRequest
//@license   MIT
// ==/UserScript==

(function () {
    'use strict';

    // 定义要点击的 input 的 id 列表
    const ids = ["rdoPass0",
        "radio_1581_column0820",
        "radio_1582_column0830",
        "radio_1583_column0840",
        "radio_1584_column0850",
        "radio_1585_column0860",
        "radio_1586_column0870",
        "radio_1587_column0880",
        "radio_1588_column0891",
        "radio_1589_column0901",
        "radio_1590_column0911",
        "radio_1591_column0921"]; // 根据实际情况修改

    // 创建按钮并添加到页面
    const button = document.createElement('button');
    button.innerText = '一键审核';
    button.style.position = 'fixed';
    button.style.bottom = '20px';
    button.style.right = '20px';
    button.style.zIndex = '1000';
    button.style.padding = '10px 20px';
    button.style.backgroundColor = '#ff4d4d';
    button.style.color = '#fff';
    button.style.border = 'none';
    button.style.borderRadius = '5px';
    button.style.cursor = 'pointer';
    document.body.appendChild(button);

    function yijianshenhe() {
        // 将 HTMLCollection 转换为数组
        const iframes = Array.from(document.getElementsByTagName('iframe'));

        // 遍历所有 iframe
        iframes.forEach(iframe => {
            // 检查 iframe 的 title 是否为 "审核答辩详情"
            if (iframe.title === "审核答辩详情") {
                // 确保 iframe 的内容已经加载
                try {
                    // 获取 iframe 的文档对象
                    const iframeDoc = iframe.contentDocument;
                    // 遍历 id 列表
                    ids.forEach(id => {
                        // 查找指定 id 的 input 元素
                        const inputElement = iframeDoc.getElementById(id);
                        // 检查元素是否存在
                        if (inputElement) {
                            // 模拟点击操作
                            inputElement.click();
                        } else {
                            console.log(`Element with id "${id}" not found in the iframe.`);
                        }
                    });
                } catch (error) {
                    console.error('Error accessing iframe content:', error);
                }
            }
        });
    }

    button.addEventListener('click', () => {
        yijianshenhe();
    });
})();

免费评分

参与人数 1吾爱币 +5 热心值 +1 收起 理由
苏紫方璇 + 5 + 1 欢迎分析讨论交流,吾爱破解论坛有你更精彩!

查看全部评分

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

dysunb 发表于 2025-5-21 20:00
点击一下就点击一遍所有目标选择框
SVIP9大会员 发表于 2025-5-21 20:23
提供了一个新的思路,挺不错的,有些页面的元素刷新会变,不知道怎么解决
MQ19781011 发表于 2025-5-21 20:53
感觉用这个方法可以做网页考试答题用呢。。。。。。
makaay 发表于 2025-5-21 21:23
多效率来讲,很实用;从实际讲,太感性!!!
乔纳森敲死他 发表于 2025-5-21 22:09
非常实用的工具,感谢分享
BrutusScipio 发表于 2025-5-22 00:00
自动点击吗?更新了怎么办
oxding 发表于 2025-5-22 09:04
可以问一下如何使用吗
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - 52pojie.cn ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2026-4-17 16:00

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表