本帖最后由 涛之雨 于 2020-9-10 20:36 编辑
[JavaScript] 纯文本查看 复制代码 javascript: void (((function(d){var g=function(a=2,b=0){return Math.floor((Math.random()*(a-b))+1)-1+b;};d.querySelectorAll(".field.ui-field-contain").forEach(function(a){if(a.querySelector(".ui-controlgroup")!==null){var b=a.querySelectorAll(".ui-radio");if(b.length!==0){b[g(b.length)].click();}else{b=a.querySelectorAll(".ui-checkbox");if(b.length!==0){b[g(b.length-1)].click();}}}else if(a.querySelector(".ui-select")!==null){var b=[];a.querySelectorAll("option").forEach(function(c,d){if(d!==0){b.push(c.innerHTML);}});var c=b[g(b.length-1)];var d=a.querySelector(".ui-select > div > span > span > span > span");d.title=c;d.innerHTML=c;}else if(a.querySelector(".rangeslider")!==null){var n=Number(a.querySelector("input").min);var m=Number(a.querySelector("input").max);a.querySelector("input").value=g(m,n);}else if(a.querySelector("table")!==null){a.querySelectorAll("table > tbody > tr").forEach(function(b){if(b.getAttribute("rowindex")!==null){var c=b.querySelectorAll("td");c[g(c.length)].click();}});}});var a=d.getElementsByTagName("select");for(var i=0;i<a.length;i++){a[i].focus();a[i].value="1";a[i].blur();}var t=setInterval(function(){if(d.querySelector("#divNext").style.display==="none"){clearInterval(t);return;}show_next_page();},100);setTimeout(function(){d.getElementById("ctlNext").click();},2000);})(document)));
上面是minify的,复制后扔到书签就行(如下图)
打开网页点一下就完成(反复使用需要手动通过验证码检测)
或者console里直接粘贴,
下面为原文件,
有需要或是有改动可以自行修改。
[JavaScript] 纯文本查看 复制代码 var getrandomchoice = function(totalnumber = 2, min = 0) {
return Math.floor((Math.random() * (totalnumber - min)) + 1) - 1 + min;
};
document.querySelectorAll(".field.ui-field-contain").forEach(function(a) {
if (a.querySelector(".ui-controlgroup") !== null) { //选择题
var b = a.querySelectorAll(".ui-radio");
if (b.length !== 0) { //单选
b[getrandomchoice(b.length)].click();
} else {
b = a.querySelectorAll(".ui-checkbox");
if (b.length !== 0) { //多选(仅做单选处理)
b[getrandomchoice(b.length - 1)].click();
}
}
} else if (a.querySelector(".ui-select") !== null) { //下拉列表
var b = [];
a.querySelectorAll("option").forEach(function(c, d) {
if (d !== 0) {
b.push(c.innerHTML);
}
});
var c = b[getrandomchoice(b.length - 1)]; //随机列表
var d = a.querySelector(".ui-select > div > span > span > span > span"); //选择的位置
d.title = c;
d.innerHTML = c;
} else if (a.querySelector(".rangeslider") !== null) { //滑块
var n = Number(a.querySelector("input").min);
var m = Number(a.querySelector("input").max);
a.querySelector("input").value = getrandomchoice(m, n);
} else if (a.querySelector("table") !== null) { //表格
a.querySelectorAll("table > tbody > tr").forEach(function(b) {
if (b.getAttribute("rowindex") !== null) {
var c = b.querySelectorAll("td");
c[getrandomchoice(c.length)].click();
}
});
}
});
//下拉框
var choose = document.getElementsByTagName("select");
for (var i = 0; i < choose.length; i++) {
choose[i].focus();
choose[i].value = "1";
choose[i].blur();
}
//模拟下一页
var tim = setInterval(function() {
if (document.querySelector("#divNext").style.display === "none") { clearInterval(tim); }
show_next_page();
}, 100);
//提交
setTimeout(function() { document.getElementById("ctlNext").click(); }, 2000); |