Git Product home page Git Product logo

scu-grab-class's Introduction

scu抢课脚本(js版)

2024/03/13更新 之前有过一个python版link,但是教务处的接口变更较大,那个维护起来就有些复杂了。

就对照接口更改了另一个版本的js脚本

const kch = '你想抢的课的课程号'
const kxh = '你想抢的课序号(如:03)'
const d = document.getElementById("ifra").contentWindow.document
d.getElementById("kch").value = kch
const interval = setInterval(() => {
    d.getElementById("queryButton").click()
    Array.from(d.getElementById("xirxkxkbody").children).forEach(e => {
        // 确定e下的label元素存在,并且该label包含一个input元素
        const inputElement = e.querySelector('td label input[type="checkbox"]');
        if (inputElement) {
            // 检查input元素的id属性是否以特定的字符串开始
            if (inputElement.id.startsWith(kch + "_" + kxh)) {
                inputElement.click(); // 点击该checkbox
                clearInterval(interval); // 停止interval
                document.getElementById("submitButton").click(); // 点击提交按钮
            }
        }
    });
}, 1000)

使用方式就是在自由选课界面,**选中有余量的课程选项!!**然后控制台输入脚本。

想抢多个课就多开几个浏览器标签页!

最后一次和选课系统作斗争了,和scu的土豆服务器说再见了!

scu-grab-class's People

Contributors

junqi1121 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.