教务系统查成绩进阶技巧

打开浏览器。
安装脚本猫插件,点击添加到浏览器的按钮:首页 | ScriptCat
在这里插入图片描述
在这里插入图片描述
在打开的页面右上角,选择新建脚本——新建普通脚本
在这里插入图片描述
全选内容清除,将下列内容贴入:

// ==UserScript==
// @name         教务系统下载所有成绩
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        自己的url
// @match        自己的url
// @icon         https://www.google.com/s2/favicons?sz=64&domain=zstu.edu.cn
// @grant        none
// @require      https://code.jquery.com/jquery-3.6.0.min.js
// ==/UserScript==

(function() {
    'use strict';

    // 创建按钮元素
    let ele = $("<button type='button' class='btn btn-default btn_dc' href='javascript:void(0);'><i class='bigger-100 glyphicon glyphicon-export'></i> 导出所有成绩</button>");

    // 按钮点击事件
    ele.click(function() {
        function downFile(blob) {
            var elementA = document.createElement('a');
            elementA.download = +new Date() + ".xlsx";
            elementA.style.display = 'none';
            elementA.href = URL.createObjectURL(blob);
            document.body.appendChild(elementA);
            elementA.click();
            document.body.removeChild(elementA);
        }

        var xhr = new XMLHttpRequest();
        xhr.open("POST", '/jwglxt/cjcx/cjcx_dcXsKccjList.html', true);
        xhr.responseType = 'blob';
        xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

        xhr.onload = function() {
            downFile(xhr.response);
        };

        xhr.send("gnmkdmKey=N305005&xnm=" + document.querySelectorAll('#xnm')[0].value + "&xqm=" + document.querySelectorAll('#xqm')[0].value + "&dcclbh=JW_N305005_GLY&exportModel.selectCol=kcmc%40%E8%AF%BE%E7%A8%8B%E5%90%8D%E7%A7%B0&exportModel.selectCol=xnmmc%40%E5%AD%A6%E5%B9%B4&exportModel.selectCol=xqmmc%40%E5%AD%A6%E6%9C%9F&exportModel.selectCol=kkbmmc%40%E5%BC%80%E8%AF%BE%E5%AD%A6%E9%99%A2&exportModel.selectCol=kch%40%E8%AF%BE%E7%A8%8B%E4%BB%A3%E7%A0%81&exportModel.selectCol=jxbmc%40%E6%95%99%E5%AD%A6%E7%8F%AD&exportModel.selectCol=xf%40%E5%AD%A6%E5%88%86&exportModel.selectCol=xmcj%40%E6%88%90%E7%BB%A9&exportModel.selectCol=xmblmc%40%E6%88%90%E7%BB%A9%E5%88%86%E9%A1%B9&exportModel.exportWjgs=xls&fileName=%E6%96%87%E4%BB%B91656485751290");
    });

    // 将按钮添加到页面中的某个位置,例如页面底部
    $('body').append(ele);
})();


按下Ctrl + S 保存
在这里插入图片描述
打开开关
在教务系统中找到成绩查询界面,并复制当前页面的url
在这里插入图片描述
将脚本中的第7、8行后面的url替换为自己的,保存
在这里插入图片描述

刷新成绩页面,此时你的页面会卡住。
滚动到画面最下方,左下角有“导出所有成绩”按钮。
点击后,浏览器会自动下载一个xls文件,里面就是所有的成绩。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值