Created
July 23, 2020 07:32
-
-
Save daimon99/f37eec60bf1b2a833124ca403ada8235 to your computer and use it in GitHub Desktop.
北京市职业技能提升平台,自动学习脚本
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 功能 | |
// 1. 自动点确定 | |
// 2. 自动点人脸验证的确定 | |
// 3. 播完一集自动播放下一集 | |
// 4. 如果视频中间有锁,会自动从最后一个不是100%的视频开始播放 | |
// 5. 可以重复执行。如果忘了自己执行过没有,就放心的多粘几次吧。 | |
var clickindex = null | |
if (typeof (run1) == 'undefined') { | |
var run1 = setInterval(() => { | |
// 自动确认播放弹窗 | |
const dom = document.getElementsByClassName('layui-layer-btn0') | |
if (dom.length > 0) { | |
document.getElementsByClassName('layui-layer-btn0')[0].click() | |
} | |
// 自动确认人脸识别弹窗 | |
const face_startbtn = document.getElementsByClassName('face_startbtn') | |
if (face_startbtn.length > 0) { | |
if ( | |
document.getElementsByClassName('face_recogn')[0].style.display !== 'none' | |
) { | |
document.getElementsByClassName('face_startbtn')[0].click() | |
} | |
} | |
// 自动播放下一集 | |
const li = document.getElementsByClassName('course_study_menuschedule') | |
const length = li.length | |
for (let index = length - 1; index >= 0; index--) { | |
const element = li[index] | |
if (element.innerText.length > 0) { | |
if ( | |
Number( | |
element.innerText.split('成')[1].replace('\n', '').replace('%', '') | |
) < 100 | |
) { | |
if (clickindex != index) { | |
console.log('now play', index) | |
clickindex = index | |
document.getElementsByClassName('course_study_menubox')[index].click() | |
} | |
break; | |
} | |
} | |
} | |
}, 1000) | |
} else { | |
console.log('已经执行过脚本了。不需要重复执行') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment