- 帖子
- 2
- 主題
- 1
- 精華
- 0
- 積分
- 50
- 點名
- 0
- 作業系統
- windows 10
- 軟體版本
- 2010
- 閱讀權限
- 20
- 性別
- 男
- 註冊時間
- 2012-1-30
- 最後登錄
- 2019-5-7
|
下載表格的問題
各位大大
想要下載如下網址輸入股票代號後的表格資料
因找不到表格的id,所以想請教各位大大有何
種方式可以下載表格,再請各位大大幫忙,謝
謝。
網址:http://www.twse.com.tw/ch/trading/exchange/FMNPTK/FMNPTKMAIN.php
程式碼如下:
Sub 年線()
Dim A As Object, E As Object
With CreateObject("InternetExplorer.Application")
.Visible = True
.Navigate "http://www.twse.com.tw/ch/trading/exchange/FMNPTK/FMNPTKMAIN.php"
Do While .ReadyState <> 4 Or .Busy: DoEvents: Loop
For Each A In .document.getelementSbyTAGNAME("INPUT")
If A.Name = "CO_ID" Then A.Value = ActiveSheet.Range("A1")
If A.Value = "查詢" Then A.Click
Next
Do While .ReadyState <> 4 Or .Busy: DoEvents: Loop
Cells.Clear
.ExecWB 17, 2
.ExecWB 12, 2
With ActiveSheet
.UsedRange.Offset(1).Clear
.Cells(2, 1).Select
.PasteSpecial Format:="HTML"
End With
.Quit
End With
End Sub |
|