教務(wù)網(wǎng)課程評(píng)價(jià)半自動(dòng)填寫腳本(測(cè)試版)
由于兼容性問題贡珊,請(qǐng)使用Chrome或谷歌系瀏覽器如360極速忙厌、搜狗瀏覽器等翩概,切勿使用IE 牲距;
雖然還需要一定手工操作,但是比全手動(dòng)方便多了钥庇,不是嗎牍鞠;
目前測(cè)試成功的瀏覽器:最新版本的Chrome和Edge;
使用步驟
登錄教務(wù)網(wǎng)评姨,點(diǎn)擊課程評(píng)價(jià)皮服,選擇一門你要填寫的課程,進(jìn)入到如下所示的頁面
TIM圖片20191125185154.png
按下鍵盤上的F12 参咙,彈出控制臺(tái)龄广,點(diǎn)擊Console
Console截圖.png
將下面的代碼復(fù)制粘貼到上圖所示區(qū)域,按下回車即可
由于教務(wù)網(wǎng)要求每份問卷至少填寫一分鐘蕴侧,請(qǐng)喝口茶耐心等待择同,這門課程填寫完畢后,再用相同操作填寫其他課程即可~
經(jīng)過測(cè)試净宵,有的電腦能夠正常運(yùn)行而有的電腦會(huì)報(bào)錯(cuò)敲才,如遇問題請(qǐng)?jiān)谠u(píng)論區(qū)聯(lián)系哦~
new class {
constructor(params) {
this.mainWindow = document.querySelector('#WindowMain8');
if (this.mainWindow) {
this.WindowFrame = this.mainWindow.querySelector('#WindowFrame8').contentDocument.childNodes[1];
} else {
this.mainWindow = document.querySelector('#WindowMain3');
this.WindowFrame = this.mainWindow.querySelector('#WindowFrame3').contentDocument.childNodes[1];
}
this.ansDiv = this.WindowFrame.querySelectorAll('.answerDiv');
this.submitBtn = this.WindowFrame.querySelector('#r_content>.b_content>.tb_cont>.frame-table>tbody>tr:nth-child(2) input:nth-child(1)');
this.select();
this.stuff();
this.submit();
}
select() {
for (let i = 0; i < this.ansDiv.length - 2; i++) {
this.ansDiv[i].childNodes[1].childNodes[3].click();
}
}
stuff() {
this.text1 = this.WindowFrame.querySelector('#answerDiv16 textarea');
this.text2 = this.WindowFrame.querySelector('#answerDiv17 textarea');
this.text1.innerText = '都很滿意';
this.text2.innerText = '暫時(shí)沒有';
this.text1.value = this.text1.innerText;
this.text2.value = this.text2.innerText;
}
submit() {
let tick = 15;
console.log(`由于必須填寫一分鐘以上,${tick} 秒后將自動(dòng)提交择葡,請(qǐng)耐心等待~`);
this.infoInterval = setInterval(() => {
tick--;
console.log(`由于必須填寫一分鐘以上紧武,${tick} 秒后將自動(dòng)提交,請(qǐng)耐心等待~`);
}, 1000);
setTimeout(() => {
clearInterval(this.infoInterval);
this.submitBtn.click();
}, tick * 1000);
}
}