|
新手作业:江苏七星彩- Sub qxc()
- Dim xml As New XMLHTTP, str As String, nam As String, send1 As String
- Dim ar, arr, i, j, n, pag
- pag = Sheet5.Range("f1")
- send1 = "{pageindex:'"
- send1 = send1 & pag
- send1 = send1 & "',lottory:'TC7XCData_jiangS',pl3:'',name:'江苏七星彩',isgp: '0'}"
- With xml
- .Open "POST", "http://www.pinble.com/Template/WebService1.asmx/Present3DList", False
- .setRequestHeader "Content-Type", "application/json; charset=utf-8"
- .setRequestHeader "Referer", "http://www.pinble.com/Lottery.htm"
- .send send1
- str = .responseText
- Debug.Print str
- End With
- Dim reg As New RegExp
- With reg
- .Global = True
- .MultiLine = True
- .Pattern = "20%;\\u0027\\u003e(.*?)\s*\\u.*?20%;\\u0027\\u003e(.*?)\s.*?lblHao\\u0027\\u003e(.*?)\\u"
- Set ar = .Execute(str)
- ReDim arr(0 To ar.Count - 1, 2)
- For i = 0 To ar.Count - 1
- For j = 0 To 2
- arr(i, j) = ar.Item(i).SubMatches(j)
- Next
- Next
- End With
- Sheet5.Cells(3, 1).Resize(65533, 4).ClearContents
- n = Sheet5.Range("a65533").End(xlUp).Row
- Sheet5.Cells(n + 1, 1).Resize(ar.Count - 1, 3) = arr
- End Sub
复制代码 |
|