|
- Sub 成绩查询()
- On Error Resume Next
- Dim arr, brr
- Dim winhttp As Object
- Set winhttp = CreateObject("MSXML2.XMLHTTP")
- With winhttp
- For k = 2 To Cells(Rows.Count, 1).End(3).Row
- xm = Cells(k, 2)
- zkzh = Cells(k, 1)
- .Open "POST", "http://edu.yunxinlink.com/api/queryExams", False
- Data = "examId=" & zkzh & "&name=" & xm
- .setRequestHeader "Referer", "http://edu.yunxinlink.com/"
- .setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
- .Send (Data)
- strText = .responsetext
- strText = "\chinese" & Split(Split(Replace(strText, """", ""), "chinese")(1), "}")(0) & ","
- brr = Array("\totalScore\:", "\chinese\:", "\math\:", "\english\:", "\science\:", "\arts\:", "\geobiology\:", "\pe\:", "\experiment\:")
- ReDim arr(1 To 9)
- For i = 0 To 8
- arr(i + 1) = Split(Split(strText, brr(i))(1), ",")(0)
- Next i
- Cells(k, 3).Resize(1, 9) = arr
- Next k
- End With
- MsgBox "OK"
- End Sub
复制代码 |
|