Skip to content

Instantly share code, notes, and snippets.

@wisecsj
Last active May 12, 2019 11:49
Show Gist options
  • Save wisecsj/41e83d914fd8a9e61596c1a41e78f1af to your computer and use it in GitHub Desktop.
Save wisecsj/41e83d914fd8a9e61596c1a41e78f1af to your computer and use it in GitHub Desktop.
实验楼实验环境下自动延迟JS
setInterval(() => {
// 显示时间的节点
var timeNode = document.querySelector(".left-time > div:nth-child(1)")
var lastTime = parseInt(timeNode.textContent)
// 延迟按钮
var btn = document.querySelector(".add-time-btn")
if (lastTime<10) {
btn.click()
// 确认延迟按钮
var sure = document.querySelector("#__BVID__65___BV_modal_footer_ > button:nth-child(2)")
sure.click()
}
}, 5000);
@wisecsj
Copy link
Author

wisecsj commented May 12, 2019

image

每次很容易错过点击延迟的时间,导致又得重新申请实验空间,配置环境,非常苦恼。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment