Excel 请问如何用VBA提取这个网页上的开奖号码

2024-07-01 08:14发布

Sub cc() ***.clearcontents Set oDoc = CreateObject(htmlfile) [a1:c1]

Sub cc() ***.clearcontents Set oDoc = CreateObject("htmlfile") [a1:c1]
2条回答
2024-07-01 08:45
Sub cc()

***.clearcontents

Set oDoc = CreateObject("htmlfile")

[a1:c1] = Array("时间", "开奖号码", "冠亚军和")

[f1] = "1~5龙虎"

[c1:e1].Merge: [f1:j1].Merge

With CreateObject("***.xmlhttp")

.Open "GET", "http://www.***.com/pk10/kaijiang", True

.Send

Do Until .ReadyState = 4

DoEvents

Loop

s = R究张eplace(Replace(.responseText, """>",
""), "pk-no", """>")

odoc.***.innerhtml = s

Set r = odoc.***.tags("table")(0).Rows

For i = 0 To ***.length - 1

For j = 0 To r(i)呢迅缩兴体色技围.***.len教出父首载裂绝gth - 1

Cells(i + 1, j + 1) = r(i).Cells(j).i示话维围矿我苏所物nnerText

Next j

Next i

Set r = Nothing

End With

End Sub

    相关问答