- ©«¤l
- 361
- ¥DÃD
- 57
- ºëµØ
- 0
- ¿n¤À
- 426
- ÂI¦W
- 0
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- 2003,2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-13
- ³Ì«áµn¿ý
- 2022-12-8
|
¦^´_ 12# hipper68
§A¸Õ¸Õ¬Ý¡AÀ³¸Ó¥i¦æ¡I- Sub ex()
- With CreateObject("internetexplorer.application")
- .Visible = True
- .Navigate "http://www.twse.com.tw/ch/trading/exchange/MI_MARGN/MI_MARGN.php"
- Do Until .ReadyState = 4
- DoEvents
- Loop
-
- .Document.getElementById("date-field").Value = "104/08/12" '¶ñ¤J
-
- '---------¡A¤º«Øªºfireevent ªºonchange¥¢®Ä¡A§ï¥Î½Õ¥Îjsªº¤èªk--------
- Set evt = .Document.createEvent("HTMLEvents")
- evt.initEvent "change", True, False
- Set lst = .Document.all("selectType") 'optionªºname¬OselectType¡A¦ýgetElementsByNameµLªk³B²z¡Anall¤~¦æ
- lst.selectedIndex = 0
- lst.dispatchEvent evt
-
- .Document.all("query-button").Click
- Do While .ReadyState <> 4 Or .Busy: DoEvents: Loop
- Application.Wait Now + TimeValue("00:00:5")
- ' Stop
-
- ' For Z = 0 To 10
- ' MsgBox .Document.getElementsByTagName("table")(Z).innerText
- ' Next
- Stop
- Set hTable = .Document.getElementsByTagName("table")(3) '²Ä4Ótable
- ' tt = hTable.Rows.Length
- ' qq = hTable.Rows(2).Cells.Length
- With ActiveSheet
- For i = 1 To hTable.Rows.Length - 1 '«e3Ó¬O¼ÐÃD»PªÅ¥Õ¸õ¹L
- For j = 0 To hTable.Rows(i).Cells.Length - 1
- .Cells(i, j + 1) = hTable.Rows(i).Cells(j).innerText
- Next
- Next
- End With
- .Quit
- ' MsgBox "OK"
- End With
-
- End Sub
½Æ»s¥N½X |
|