- ©«¤l
- 142
- ¥DÃD
- 18
- ºëµØ
- 0
- ¿n¤À
- 160
- ÂI¦W
- 317
- §@·~¨t²Î
- win10 64¦ì¤¸
- ³nÅ骩¥»
- office2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- »OÆW °ª¶¯¥«
- µù¥U®É¶¡
- 2015-7-18
- ³Ì«áµn¿ý
- 2024-11-28
|
¦^´_ 49# no3-taco
¥H¤U¤º®e¥i¯à¦³»~ ¦]¬°ÁÙ¬O¥X²{°T®§ "400"
Sub test()
Dim E As Object, AR(), i As Integer
AR = Array("http://www.yuantaetfs.com/#/RtNav/Index", "http://www.yuantaetfs.com/#/Home/Index")
'Ar = Array(ºô§}:§Y®É²bÈ,ºô§}:°ê¤º«ü¼Æ) ºô§}¸m¤J°}¦C
ActiveSheet.UsedRange.Clear
For i = 0 To 1
With CreateObject("InternetExplorer.Application")
.Visible = True
.Navigate AR(i)
Do While .Busy Or .readyState <> 4: DoEvents: Loop
If i = 0 Then '°ê¤º«ü¼Æ:¤£»Ý«ö¤U¦P·NÁä
Do
Set E = .Document.getElementByid("Agree")
Loop Until Not E Is Nothing
E.Click
End If
.Visible = False
Application.VBE.MainWindow.Visible = True
Application.VBE.Windows("§Y®É¹Bºâ").Visible = True
Stop '¤§«á«ö¤UF5
Do
Do
Set E = .Document.getElementsByTagName("TABLE")(21 + i)
'§Y®É²bÈ ²Ä21Ó "TABLE" ,'°ê¤º«ü¼Æ ²Ä22Ó "TABLE"
Debug.Print i, "e Is Nothing ->", E Is Nothing
Loop Until Not E Is Nothing
Debug.Print i, "e Is Nothing ->", E Is Nothing, "e.all.Length", E.all.Length
Loop Until E.all.Length >= IIf(i = 0, 415, 135) '
Stop '¤§«á«ö¤UF5
Application.VBE.Windows("§Y®É¹Bºâ").Visible = False
Application.VBE.MainWindow.Visible = False
.Document.body.innerHTML = E.outerHTML
.ExecWB 17, 2 ' Select All
.ExecWB 12, 2 ' Copy selection
With ActiveSheet
.Range("A" & IIf(i = 0, 1, 27)).Select
.PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:=False, NoHTMLFormatting:=True
With .Range(IIf(i = 0, "D16:D17", "C27:C28")).Interior
.ColorIndex = 35
.Pattern = xlSolid
End With
End With
.Quit 'Ãö³¬ºô¶
End With
Next
End Sub
|
|