AutoBrowse

自动刷新网页

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         AutoBrowse
// @namespace    http://tampermonkey.net/
// @version      0.4.13
// @description  自动刷新网页
// @author       zhaiwei
// @match        https://jdydt.ccdi.gov.cn/*
// @icon         https://jdydt.ccdi.gov.cn/favicon.ico
// @grant        none
// @run-at       document-end

// ==/UserScript==

(function() {
    'use strict';
    console.log('开始访问网页!');
    let time=suiji(0.9,1.1)
    function suiji(start,end) {
        return Math.round((Math.random()*(end-start)+start)*1000)
    }

    window.setInterval(function() {
        //location.reload();
        var wt = 800;
        
        console.log(time);
        if($('span:contains(去选择)')){
        setTimeout("$('span:contains(去选择)')[0].click();",wt * 0.125);
        }else{
            setTimeout("document.querySelector('.el-icon-location').click();",wt * 0.125);
        }
        
        setTimeout("$('span:contains(全国)')[0].click()",wt * 0.525);

        setTimeout("$('span:contains(安徽省)')[0].click()",wt * 1);

        setTimeout("$('span:contains(宿州市)')[0].click()",wt * 2);

        setTimeout("$('span:contains(泗县)')[0].click()",wt * 3);

        setTimeout("$('span:contains(草沟镇)')[0].click()",wt * 4);

        setTimeout("$('span:contains(于城村)')[0].click()",wt * 5);
        
        setTimeout("$('.common-item-body')[parseInt(Math.random()*14)].click()",time * 7);
        
        setTimeout("window.location.href= 'https://jdydt.ccdi.gov.cn/#/'",time * 8);
        
        setTimeout("window.location.reload()",time * 8.5);

    },time * 9);

    // Your code here...
})();