Colab 防断开
鼠标右键,检查,在console先输入如下代码
function ConnectButton(){
console.log("Connect pushed");
document.querySelector("#top-toolbar > colab-connect-button").shadowRoot.querySelector("#connect").click()
}
setInterval(ConnectButton,60000);
过几秒钟再输入如下代码:
function closeButton(){
console.log("close");
document.querySelector("body > colab-dialog > paper-dialog > colab-sessions-dialog").shadowRoot.querySelector("#footer > div > paper-button.dismiss").click()
}
setInterval(ConnectButton,60000);
以上js脚本实现对colab以下部分的连接 与关闭,防止colab断开
kaggle防断开
先输入
function closeButton(){
console.log("close");
document.querySelector("#root > div > div > div.AppView-sc-16eb2j.kZXkZl > div.App_Body-sc-16c8j4p.hxOBfv > div.Layout_Body-sc-6piylv.bXAYPy > div > div > div > div.ToolbarContainer_Body-sc-2h8iu7.fhvgBU > button").click()
}
setInterval(closeButton,60000);
过几秒再输入
function closeButton(){
console.log("close");
document.querySelector("#root > div > div > div.AppView-sc-16eb2j.kZXkZl > div.App_Body-sc-16c8j4p.hxOBfv > div.Layout_Body-sc-6piylv.bXAYPy > div > div > div > div.ToolbarContainer_Body-sc-2h8iu7.fhvgBU > div.DetailedStatus_Body-sc-zfwb95.fMzpPO > button > i").click()
}
setInterval(closeButton,60000);
道理和colab差不多,通过点击kaggle页面实现防断开