代码拉取完成,页面将自动刷新
window.onload = function(){
if(window.location.href.indexOf("https://www.wjx.cn/wjx/join/complete.aspx")>-1){
window.location.href="https://www.wjx.cn/vj/PprjttC.aspx";
}
setTimeout(()=>{
startMain();
},3000)
}
//题目内容div
var survey = '';
//里面的列表
var fieldset1 = '';
var divQuestion = '';
var questionNum = 0;
var scrollTotal = document.body.scrollHeight-window.innerHeight
//函数入口
function startMain(){
console.log("fxxk");
survey = document.getElementById("ctl00_ContentPlaceHolder1_JQ1_surveyContent");
fieldset1 = document.getElementById("fieldset1");
divQuestion = document.getElementsByClassName("div_question");
//获取题目的长度
questionNum = divQuestion.length;
//console.log(questionNum);
answerQuestion(questionNum);
}
//某道题的选项ul列表标签
var radioUl = '';
var radioLi = '';
var firstA = '';
var answerType = ''
function answerQuestion(qn){
console.log("接收到"+qn)
let i = 0;
var exAws = setInterval(() => {
if(i==qn){
clearInterval(exAws);
//答卷完毕,准备提交
document.getElementById("submit_button").click();
setTimeout(() => {
if(document.getElementById("alert_box")){
document.getElementById("alert_box").getElementsByClassName("mainBgColor")[0].click();
setTimeout(() => {
document.getElementsByClassName("out-silder-circle")[0].click();
}, 1500);
}
}, 3000);
}
else{
radioUl = divQuestion[i].getElementsByClassName("ulradiocheck");
radioLi = divQuestion[i].getElementsByTagName("li");
answerType = divQuestion[i].getElementsByTagName("li")[0].getElementsByTagName("input")[0].getAttribute("type");
//console.log(answerType);
//console.log(i)
fillAnswer(i);
//console.log(radioUl)
i++;
}
}, 1000);
}
function fillAnswer(n){
var length = radioLi.length;
//console.log("答案有"+length+"个")
//判断单选还是多选
if(answerType=='radio'){
//如果是单选,随机选一个选项
var answerChoose = Math.round(Math.random()*(length-1));
console.log(answerChoose)
divQuestion[n].getElementsByTagName("li")[answerChoose].getElementsByTagName("a")[0].click();
}
else if(answerType=='checkbox'){
//如果是多选,先随机出要选几个答案,再随机选择
var answerNum = Math.ceil(Math.random()*length);
var answerArray = [];
var answerChoose;
console.log("答案有:"+answerNum+"个")
for(let i = 0;i<answerNum;i++){
answerChoose = Math.round(Math.random()*(length-1));
console.log("-------------------")
console.log(answerArray)
console.log(answerChoose)
console.log("-------------------")
//防止两次随机到一样的选项
while(answerArray.indexOf(answerChoose)>-1){
answerChoose = Math.round(Math.random()*(length-1));
}
divQuestion[n].getElementsByTagName("li")[answerChoose].getElementsByTagName("a")[0].click();
answerArray.push(answerChoose)
}
}
window.scrollBy(0,scrollTotal/questionNum)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。