• 油猴tampermonkey 与jquery 根据传参,自动操作页面


    // ==UserScript==
    // @name         提现审批同意
    // @namespace    http://tampermonkey.net/
    // @version      0.1
    // @description  try to take over the world!
    // @author       You
    // @run-at       document-body
    // @match        https://a.58ccp.com/admin/inoutCash/outCash/supplierIndex.jhtml*
    // @require      https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js
    // @require      https://cdn.bootcdn.net/ajax/libs/lodash.js/4.17.19/lodash.js
    // @require      https://cdn.bootcdn.net/ajax/libs/mobx/5.15.5/mobx.umd.js
    // @require      https://cdn.bootcdn.net/ajax/libs/layer/3.1.1/layer.min.js
    // @require      https://cdn.bootcdn.net/ajax/libs/dayjs/1.8.32/dayjs.min.js
    /* globals layer */
    /* globals _ */
    /* globals mobx */
    /* globals dayjs */
    /* globals jQuery, $, waitForKeyElements */
    // @grant  GM_addStyle
    // @grant GM_setClipboard
    // ==/UserScript==
    
    
    // window._jquery = $.noConflict(true);
    // window._lodash = _.noConflict();
    
    function getQueryVariable(variable)
    {
           var query = window.location.search.substring(1);
           var vars = query.split("&");
           for (var i=0;i<vars.length;i++) {
                   var pair = vars[i].split("=");
                   if(pair[0] == variable){return pair[1];}
           }
           return(false);
    }
    
    function querySelectorIncludesText (selector, text){
      return Array.from(document.querySelectorAll(selector))
        .find(el => el.textContent.includes(text));
    }
    
    (function () {
        'use strict';
        var act = getQueryVariable("act");
        if(act=='agree'){
            	setTimeout(function() {
                    document.querySelector('.auditDraw').click();
                    setTimeout(function() {
                        document.getElementsByName("auditOpinion")[0].value = "同意";
                         setTimeout(function() {
                             querySelectorIncludesText('button', '提交').click();
                        }, 500);
                    }, 500);
    			}, 1000);
        }
    })();
    

      

  • 相关阅读:
    Luogu-P2295 MICE
    Luogu-P2627 修剪草坪
    Loj-10176-最大连续和
    Luogu-P1886 滑动窗口
    Luogu-P3807 【模板】卢卡斯定理
    Luogu-P1879 [USACO06NOV]玉米田Corn Fields
    Luogu-P1896 [SCOI2005]互不侵犯
    Loj-SGU 223-国王
    Luogu-P2657 [SCOI2009]windy数
    素数
  • 原文地址:https://www.cnblogs.com/meetrice/p/15778167.html
Copyright © 2020-2023  润新知