油猴tampermonkey 与jquery 根据传参,自动操作页面
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | // ==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); } })(); |
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步