Automatically fill in the questionnaire star-js

Automatically fill in the questionnaire

Today, my girlfriend asked her to fill out 100 questionnaires. Isn't this killing me. . . !
It is impossible for a programmer to fill out the questionnaire honestly, it is impossible in this life.

effect

Since the code is written by native js, it will basically not fail unless the source code is changed. The effect of doing it by myself is also perfect to achieve the desired function.

The program can choose the answer you want according to your own needs. Note that this answer cannot be randomly generated.

Practice

First open the chrome browser (same as other browsers) and press F12 to call up the console. Obviously, the questionnaire star has also done a little trick (as long as we come out of the console, it will keep budugger), we click the breakpoint on the right to jump Over.

Insert picture description here
Insert picture description here
Enter the code in the console:

Code:

// 在这里配置要选择的选项,序号都按出现顺序从0开始
// 单选框选项
var choose = [0,3,8,11,15,21,27,32,33,38,39,43,45,51];

// 多选选项
var checkBoxChoose = [2,4,6,7,8,9,12,13,14,15,18,19,20,23,24,26,28,30,31,32,33,36,40,41,42,43,44,45];

var list = $('input[type="radio"]');

for(var i = 0; i < choose.length; i++){
    
    

    list[choose[i]].checked = true;
    
    list[choose[i]].click()

}

var list1 = $('input[type="checkbox"]');

for (var i = 0; i < checkBoxChoose.length; i++) {
    
    
         list1[checkBoxChoose[i]].checked = true
         list1[checkBoxChoose[i]].click();
	};

window.scrollTo(0,document.body.scrollHeight); //窗口滑动到底部,这步可以不用

document.getElementById("ctlNext").click(); // 提交问卷

If you want to fill in randomly, just change it yourself

Guess you like

Origin blog.csdn.net/weixin_43957211/article/details/115030079