-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
41 lines (36 loc) · 1.43 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
var all;
$.ajax({
type:"POST",
url: "https://wegdut.yoricklee.com/cet",
ContentType: "application/x-www-form-urlencoded",
async:false,
data:{
zkzh:"440380162119017",
xm:"徐静"
},
success:function(msg){
console.log(msg);
return;
},
error:function(msg){
all=msg.responseText;
console.log(cut(all,"听<span class='space_long'> </span>力","<td>","</td>"))
console.log(cut(all,"阅<span class='space_long'> </span>读","<td>","</td>"))
console.log(cut(all,"写作和翻译","<td>","</td>"))
console.log(cut(all,"总<span class='space'> </span>分",'<span class="colorRed">',"</span>"))
console.log(cutForLevel(all,"考试级别","</td>"))
return;
},
});
function cut(str,start,middle,end){
var stepOne = str.slice(str.indexOf(start)+start.length,str.indexOf(end,str.indexOf(start)+start.length))
var stepTwo = stepOne.slice(stepOne.indexOf(middle)+middle.length)
return parseInt(stepTwo)
}
function cutForLevel(str,start,end){
// console.log('<td colspan="2">'.length)
var stepOne = str.slice(str.indexOf(start),str.indexOf(end,str.indexOf(start)))
if (stepOne.match("英语四级")) {return "英语四级"}
else if (stepOne.match("英语六级")) {return "英语六级"}
else return "false"
}