|
是不是网速太慢造成的?加上延时看看吧,3秒不够你就再多加几秒试试- Sub SpecialStocksInfo()
- Dim i As Integer, SpecialStockLength As Double, j As Integer
- Dim r As Variant
- Cells.ClearContents
- For p = 2 To 2
- On Error Resume Next
- With CreateObject("internetexplorer.application")
- .Visible = True
- .navigate "http://www.hkexnews.hk/listedco/listconews/advancedsearch/search_active_main.aspx"
- Do Until .readystate = 4
- DoEvents
- Loop
- .Document.all.tags("INPUT")(5).Value = "00405"
- .Document.all.tags("INPUT")(12).Click
- .Document.all.tags("select")(12).Value = "Year"
- .Document.forms(0).submit
- t = Timer
- Do While .busy Or t + 3 > Timer
- DoEvents
- Loop
- k = 0
- Set r = .Document.all.tags("td")
- ReDim Arr(1 To r.Length / 4, 1 To 4)
- For i = 85 To r.Length - 1
- Arr((i - 85) \ 4 + 1, k Mod 4 + 1) = r(i).innerText
- k = k + 1
- Next i
- [a1].Resize(UBound(Arr), 4) = Arr
- End With
- Next p
- End Sub
复制代码 |
评分
-
2
查看全部评分
-
|