xmlhttp读取frame中的内容
各位高手:
http://www.10bet.com/sports/soccer/?utm_campaign=soccer?LeaguesCollection=10098
双击“Argentina - Primera Div”,如何取得以下内容?
[解决办法]
我碰到了相同的问题,一起等高手解决。
[解决办法]
用EXCEL的vba:
Private Sub CommandButton1_Click()
On Error Resume Next
With CreateObject("WinHttp.WinHttpRequest.5.1")
.Open "POST", "http://cn.10bet.com/pagemethods.aspx/UpdateEvents", False
.setRequestHeader "requesttarget", "AJAXService"
.setRequestHeader "Referer", "http://cn.10bet.com/sports/足球/?utm_source=shp&utm_medium=sleft&utm_campaign=soccer"
.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
.setRequestHeader "Host", "cn.10bet.com"
.setRequestHeader "Connection", "Keep-Alive"
.send "requestString=5100140@5100141@5100142@5100143@5100144@5100145"
tt = "brr=" & .responsetext
With CreateObject("MSScriptControl.ScriptControl")
.Language = "JScript"
.AddCode tt
For i = 0 To 5
For j = 1 To 3
k = .Eval("brr[" & i & "][2][0][1][" & (j - 1) * 2 + 1 & "]")
If k > 0 Then
Cells(i + 1, j) = Format(k / 100 + 1, "00.00")
Else
Cells(i + 1, j) = Format(1 - 100 / k, "00.00")
End If
Next j
'Cells(i + 1, 4) = .Eval("brr[" & i & "][2][0][2][1]")
'Cells(i + 1, 5) = .Eval("brr[" & i & "][2][0][2][2]")
'Cells(i + 1, 6) = .Eval("brr[" & i & "][2][0][2][4]")
'Cells(i + 1, 7) = .Eval("brr[" & i & "][2][0][3][1]")
'Cells(i + 1, 8) = .Eval("brr[" & i & "][2][0][3][2]")
'Cells(i + 1, 9) = .Eval("brr[" & i & "][2][0][3][4]")
Next i
End With
End With
End Sub
Private Sub CommandButton1_Click()
On Error Resume Next
With CreateObject("WinHttp.WinHttpRequest.5.1")
.Open "POST", "http://cn.10bet.com/pagemethods.aspx/UpdateEvents", False
.setRequestHeader "requesttarget", "AJAXService"
.setRequestHeader "Referer", "http://cn.10bet.com/sports/足球/?utm_source=shp&utm_medium=sleft&utm_campaign=soccer"
.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
.setRequestHeader "Host", "cn.10bet.com"
.setRequestHeader "Connection", "Keep-Alive"
.send "requestString=5099300@5099301@5099302@5099303@5099304@5099391@5099392@5099393@5100555@5100924"
tt = "brr=" & .responsetext
With CreateObject("MSScriptControl.ScriptControl")
.Language = "JScript"
.AddCode tt
For i = 0 To 9
For j = 1 To 3
k = .Eval("brr[" & i & "][2][0][1][" & (j - 1) * 2 + 1 & "]")
If k > 0 Then
Cells(i + 1, j + 2) = Format(k / 100 + 1, "00.00")
Else
Cells(i + 1, j + 2) = Format(1 - 100 / k, "00.00")
End If
Next j
Next i
End With
.Open "POST", "http://cn.10bet.com/pagemethods.aspx/GetLeaguesContent", False
.setRequestHeader "requesttarget", "AJAXService"
.setRequestHeader "Referer", "http://cn.10bet.com/sports/足球/?utm_source=shp&utm_medium=sleft&utm_campaign=soccer"
.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
.setRequestHeader "Host", "cn.10bet.com"
.setRequestHeader "Connection", "Keep-Alive"
.send "BranchID=1&LeaguesCollection=8756"
tt = "brr=" & .responsetext
With CreateObject("MSScriptControl.ScriptControl")
.Language = "JScript"
.AddCode tt
For i = 0 To 9
Cells(i + 1, 1) = .Eval("brr[0][1][" & i & "][1]")
Cells(i + 1, 2) = .Eval("brr[0][1][" & i & "][2]")
Next i
End With
End With
End Sub