本帖最后由 719404338 于 2018-8-12 17:27 编辑
- Sub t()
- Dim arr, i%, j%, p%
- On Error Resume Next
- [a1] = "序号"
- [b1] = "代码"
- [c1] = "简称"
- [d1] = "千股千评"
- [e1] = "收盘价"
- [f1] = "涨跌幅"
- [a2:f4000].Clear
- With CreateObject("Microsoft.XMLHTTP")
- p = 2
- For j = 1 To 115
- .Open "GET", "http://quote.stockstar.com/Comment/5_1_" & j & ".html", True
- .Send
- Do Until .ReadyState = 4
- DoEvents
- Loop
- arr = Split(StrConv(.responsebody, vbUnicode, &H804), "<tr><td class=")
- For i = 1 To 30
- Cells(p, 1) = Split(Split(arr(i), ">")(1), "<")(0)
- Cells(p, 2) = Split(Split(arr(i), ">")(3), "<")(0)
- Cells(p, 3) = Split(Split(arr(i), ">")(6), "<")(0)
- Cells(p, 4) = Split(Split(arr(i), ">")(9), "<")(0)
- Cells(p, 5) = Split(Split(arr(i), ">")(12), "<")(0)
- Cells(p, 6) = Split(Split(arr(i), ">")(16), "<")(0)
- p = p + 1
- Next i
- Next j
- End With
- End Sub
复制代码 |