- 首先選擇自主選課
打開兩個窗口,一個用於搶課,一個用於查看是否搶成功。
這裏寫上B200,這個是網課的開頭
點擊通識選修課
選擇有餘量
在空白地方點擊鼠標右鍵,選擇查看元素或者檢查,
點擊控制檯
或者是 console最後把代碼複製進去回車即可
此處屏蔽了化學與健康,,橡膠與人類,走進工程圖學
高級用法:自己選擇篩選條件,最後複製代碼,回車即可
當在控制檯下看見循環增加的數字時即代表正常運行,當有且僅有一個 搶課成功的彈窗時,代表成功,若還有其他彈窗,則失敗
打開另一個自主選課窗口,右側有查看選課
在此查看剛剛搶到的課。
用記事本寫,代碼比較亂,見諒
var i = 0;k=0;
warn = ' ';
function begin(){
var course_block1=document.getElementsByClassName('panel panel-info');
var name1 = document.getElementsByClassName("btn btn-primary btn-sm");
var course_block=document.getElementsByClassName("body_tr");
if(course_block[k])
{
for (k=0;k<course_block.length;k++){
if(course_block[k].children[19].children[0].textContent==="選課"){
var select = document.getElementsByClassName('panel-title')[k].children[0].children[0].firstChild.data;
if(select!="走近工程圖學"&&select!="橡膠與人類"&&select!="化學與健康")
{
course_block[k].children[19].children[0].click()
//course_block[k].children[19].children[0].click();
alert("成功");
console.log("成功");
}
}
}
}
name1[0].click()
console.log(i);
i++;
}
function go()
{
document.getElementById("kxqxktskg").value = 0;
var course_block1=document.getElementsByClassName('panel panel-info');
for (j=1;j<=course_block1.length-1;j++){
course_block1[j].children[0].children[7].click();
};
setTimeout(begin,200)
}
setInterval(go,500);