功能
- 一键评教(仅限普通课程)
- 手动提交,请人工确认
使用教程
- 打开Chrome浏览器登录评教界面
- F12呼出开发人员工具
- 选择控制台
- 粘贴代码
- 回车
学习思路
分析页面框架
F12审查元素
经验告诉我:现在好多网页都是内部含框架,直接写代码肯定会报错
分析网页框架,发现有两个嵌套框架,所以我们需要先进入框架2中
iframe = document.getElementById("main");//进入框架一
iframe = iframe.contentWindow.document.getElementById("examTableFrame");//进入框架二
//调用时 document>iframe.contentWindow.document
contentDocument 属性
能够以 HTML 对象来返回 iframe 中的文档,简单来说就是将主document替换为框架内部的document
菜鸟论坛详解,但是例子不太好(太高深了看不懂),所以自己总结了上述这个例子进行理解
分析事件
分析网页元素
// 选项ID>checkbox类型>发现可点击onclick>调用函数
//所以只用模拟点击事件即可(click)
<input id="" name="firstcb_1" type="checkbox" οnclick="var vpn_return;eval(vpn_rewrite_js((function () { chooseOne(this,'firstcb_1'); }).toString().slice(14, -2), 2));return vpn_return;" value="5" checked="true">
// 文本框>text类型>使用Value方法赋值文本框内容
<input type="text" maxlength="100" name="fourthcb_1" value="教学认真" id="fourthcb_1" style="width:600px">
// 单选卡>radio类型>使用checked方法模拟勾选
<input type="radio" name="shouhuo" value="1" checked="true/">
模拟事件
具体不细讲,主要是分为定位元素+事件
此处要特别主要document应替换为iframe.contentWindow.document,我可能会写一篇常见的JS事件方法
输入文字
同上,通过给元素的value赋值即可
可优化之处
夸夸老师
可以从更多的方面夸老师,比如写点随机语句啥的
自动提交
也能做,就是怕有时候定位出问题,所以手动点击确认一下
连续提交
Emma,能做,但是不敢做
CV工程师参考文献
Checkbox菜鸟论坛
无意中发现的快速导出JS路径
源代码
/*Obfuscated by JShaman.com*/iframe=document['getElementById']('main');iframe=iframe['contentWindow']['document']['getElementById']('examTableFrame');iframe['contentWindow']['document']['querySelector']('#\x5c32\x201\x20>\x20td:nth-child(8)\x20>\x20input[type=checkbox]')['click']();try{iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(5)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(7)\x20>\x20td:nth-child(9)\x20>\x20input[type=checkbox]')['click']();iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(5)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(8)\x20>\x20td:nth-child(9)\x20>\x20input[type=checkbox]')['click']();iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(5)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(9)\x20>\x20td:nth-child(9)\x20>\x20input[type=checkbox]')['click']();iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(5)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(10)\x20>\x20td:nth-child(9)\x20>\x20input[type=checkbox]')['click']();iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(5)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(11)\x20>\x20td:nth-child(9)\x20>\x20input[type=checkbox]')['click']();iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(5)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(12)\x20>\x20td:nth-child(9)\x20>\x20input[type=checkbox]')['click']();iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(5)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(13)\x20>\x20td:nth-child(9)\x20>\x20input[type=checkbox]')['click']();iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(5)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(14)\x20>\x20td:nth-child(9)\x20>\x20input[type=checkbox]')['click']();}catch{x=0x24791^0x2479b;}try{iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(3)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(7)\x20>\x20td:nth-child(9)\x20>\x20input[type=checkbox]')['click']();iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(3)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(8)\x20>\x20td:nth-child(9)\x20>\x20input[type=checkbox]')['click']();iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(3)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(9)\x20>\x20td:nth-child(9)\x20>\x20input[type=checkbox]')['click']();iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(3)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(10)\x20>\x20td:nth-child(9)\x20>\x20input[type=checkbox]')['click']();iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(3)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(11)\x20>\x20td:nth-child(9)\x20>\x20input[type=checkbox]')['click']();iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(3)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(12)\x20>\x20td:nth-child(9)\x20>\x20input[type=checkbox]')['click']();iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(3)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(13)\x20>\x20td:nth-child(9)\x20>\x20input[type=checkbox]')['click']();iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(3)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(14)\x20>\x20td:nth-child(9)\x20>\x20input[type=checkbox]')['click']();}catch{x=0xdaaeb^0xdaae1;}iframe['contentWindow']['document']['querySelector']('#\x5c32\x202\x20>\x20td:nth-child(9)\x20>\x20input[type=checkbox]')['click']();iframe['contentWindow']['document']['querySelector']('#\x5c32\x203\x20>\x20td:nth-child(9)\x20>\x20input[type=checkbox]')['click']();iframe['contentWindow']['document']['querySelector']('#\x5c32\x204\x20>\x20td:nth-child(9)\x20>\x20input[type=checkbox]')['click']();iframe['contentWindow']['document']['querySelector']('#\x5c32\x205\x20>\x20td:nth-child(9)\x20>\x20input[type=checkbox]')['click']();iframe['contentWindow']['document']['querySelector']('#\x5c32\x206\x20>\x20td:nth-child(9)\x20>\x20input[type=checkbox]')['click']();iframe['contentWindow']['document']['querySelector']('#\x5c32\x207\x20>\x20td:nth-child(9)\x20>\x20input[type=checkbox]')['click']();iframe['contentWindow']['document']['querySelector']('#\x5c32\x208\x20>\x20td:nth-child(9)\x20>\x20input[type=checkbox]')['click']();iframe['contentWindow']['document']['querySelector']('#fourthcb_1')['value']='教学认真';iframe['contentWindow']['document']['querySelector']('#fourthcb_2')['value']='无';iframe['contentWindow']['document']['querySelector']('#fourthcb_3')['value']='系统性高';iframe['contentWindow']['document']['querySelector']('#fourthcb_4')['value']='无';try{try{iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(5)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(22)\x20>\x20td:nth-child(2)\x20>\x20input[type=radio]:nth-child(1)')['checked']=!![];iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(5)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(23)\x20>\x20td:nth-child(8)\x20>\x20b\x20>\x20input[type=checkbox]')['click']();}catch(_0x322998){iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(3)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(22)\x20>\x20td:nth-child(2)\x20>\x20input[type=radio]:nth-child(1)')['checked']=!![];iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(3)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(23)\x20>\x20td:nth-child(8)\x20>\x20b\x20>\x20input[type=checkbox]')['click']();}}catch{}try{try{iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(5)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(23)\x20>\x20td:nth-child(2)\x20>\x20input[type=radio]:nth-child(1)')['checked']=!![];iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(5)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(24)\x20>\x20td:nth-child(8)\x20>\x20b\x20>\x20input[type=checkbox]')['click']();}catch(_0x14837c){iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(3)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(23)\x20>\x20td:nth-child(2)\x20>\x20input[type=radio]:nth-child(1)')['checked']=!![];iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(3)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(24)\x20>\x20td:nth-child(8)\x20>\x20b\x20>\x20input[type=checkbox]')['click']();}}catch{}try{try{iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(5)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(24)\x20>\x20td:nth-child(2)\x20>\x20input[type=radio]:nth-child(1)')['checked']=!![];iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(5)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(25)\x20>\x20td:nth-child(8)\x20>\x20b\x20>\x20input[type=checkbox]')['click']();}catch(_0x25b128){iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(3)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(24)\x20>\x20td:nth-child(2)\x20>\x20input[type=radio]:nth-child(1)')['checked']=!![];iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(3)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(25)\x20>\x20td:nth-child(8)\x20>\x20b\x20>\x20input[type=checkbox]')['click']();}}catch{}try{try{iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(5)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(25)\x20>\x20td:nth-child(2)\x20>\x20input[type=radio]:nth-child(1)')['checked']=!![];iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(5)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(26)\x20>\x20td:nth-child(8)\x20>\x20b\x20>\x20input[type=checkbox]')['click']();}catch(_0x27f5af){iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(3)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(25)\x20>\x20td:nth-child(2)\x20>\x20input[type=radio]:nth-child(1)')['checked']=!![];iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(3)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(26)\x20>\x20td:nth-child(8)\x20>\x20b\x20>\x20input[type=checkbox]')['click']();}}catch{}try{try{iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(5)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(26)\x20>\x20td:nth-child(2)\x20>\x20input[type=radio]:nth-child(1)')['checked']=!![];iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(5)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(27)\x20>\x20td:nth-child(8)\x20>\x20b\x20>\x20input[type=checkbox]')['click']();}catch(_0x303f8c){iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(3)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(26)\x20>\x20td:nth-child(2)\x20>\x20input[type=radio]:nth-child(1)')['checked']=!![];iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(3)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(27)\x20>\x20td:nth-child(8)\x20>\x20b\x20>\x20input[type=checkbox]')['click']();}}catch{}try{try{iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(5)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(27)\x20>\x20td:nth-child(2)\x20>\x20input[type=radio]:nth-child(1)')['checked']=!![];iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(5)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(28)\x20>\x20td:nth-child(8)\x20>\x20b\x20>\x20input[type=checkbox]')['click']();}catch(_0x16e474){iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(3)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(27)\x20>\x20td:nth-child(2)\x20>\x20input[type=radio]:nth-child(1)')['checked']=!![];iframe['contentWindow']['document']['querySelector']('body\x20>\x20div:nth-child(3)\x20>\x20form\x20>\x20table\x20>\x20tbody\x20>\x20tr:nth-child(28)\x20>\x20td:nth-child(8)\x20>\x20b\x20>\x20input[type=checkbox]')['click']();}}catch{}