您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
自动填写教务系统评价并点击保存按钮
该油猴(Tampermonkey)脚本专为 SYNU(沈阳师范大学) 的一键教务系统评价设计,用户可以通过此脚本自动填写评价内容并点击保存按钮。脚本将在页面上添加一个按钮,点击后自动完成以下操作:
id="Button1"
),完成评价的提交。首先,你需要安装 Tampermonkey 扩展,这是一个管理油猴脚本的浏览器插件。
// ==UserScript==
// @name SYNU 一键教务系统评价
// @namespace http://tampermonkey.net/
// @version 1.1
// @description 自动填写教务系统评价并点击保存按钮
// @author 你的名字
// @match *://*/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
// 确保脚本只在父页面中运行,避免在iframe中创建按钮
if (window !== window.top) return; // 如果当前窗口是嵌套在iframe中,就直接退出
// 检查按钮是否已经存在
if (document.getElementById('myCustomButton')) return;
// 创建按钮
const button = document.createElement('button');
button.id = 'myCustomButton'; // 给按钮添加一个唯一的id
button.textContent = '执行操作';
button.style.position = 'fixed';
button.style.top = '10px';
button.style.right = '10px';
button.style.zIndex = '10000';
button.style.backgroundColor = '#4CAF50';
button.style.color = 'white';
button.style.border = 'none';
button.style.padding = '10px 20px';
button.style.cursor = 'pointer';
button.style.borderRadius = '5px';
button.style.display = 'flex';
button.style.alignItems = 'center'; // 垂直居中
button.style.justifyContent = 'center'; // 水平居中
button.style.fontSize = '16px'; // 调整字体大小
// 将按钮添加到页面
document.body.appendChild(button);
// 按钮点击事件
button.addEventListener('click', () => {
try {
// 操作iframe中的内容
const iframe = document.getElementById("iframeautoheight");
if (iframe && iframe.contentWindow) {
const itable = iframe.contentWindow.document.getElementById("trPjs");
const irows = itable.getElementsByTagName("select");
for (let i = 0; i < irows.length; i++) {
if (i % 11 === 0) {
irows[i].value = "良好";
} else {
irows[i].value = "优秀";
}
}
// 找到并点击保存按钮(Button1)
const button1 = iframe.contentWindow.document.getElementById('Button1');
if (button1) {
button1.click(); // 模拟点击保存按钮
} else {
console.error('未找到保存按钮');
}
} else {
console.error('无法找到指定的iframe');
}
} catch (error) {
console.error('执行过程中发生错误:', error);
}
});
})();
确保脚本已经启用,并在你需要执行的教务系统页面上生效。你可以在 Tampermonkey 仪表盘中查看脚本是否处于启用状态。
select
元素,选项分别为“良好”和“优秀”。id="Button1"
的保存按钮,提交表单。id="iframeautoheight"
的 iframe
元素,并且 iframe
中有 id="trPjs"
的表格。脚本将基于这些元素来操作页面。Button1
按钮,请确保该按钮存在并具有正确的 id
。该脚本是开源的,用户可以根据需要进行修改和分发。
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址