返回列表 上一主題 發帖

[發問] 上市個股日成交資訊下載改版建議

回復 10# t8899
  1. Sub 巨集1()
  2. '
  3.     Cells.Clear
  4.     With ActiveSheet.QueryTables.Add(Connection:= _
  5.         "URL;http://www.twse.com.tw/exchangeReport/MI_INDEX?response=html&date=20170524&type=ALLBUT0999", Destination:=Range("$A$1"))
  6.         .WebTables = "5"
  7.         .Refresh BackgroundQuery:=False
  8.     End With
  9. End Sub
複製代碼
不是每個網頁都可以 指定表格下載,有的頁面只能全頁下載

TOP

本帖最後由 prin.huang 於 2017-5-24 21:24 編輯
改為json格式,或是下載csv檔,原本的網頁下載也行
joey0415 發表於 2017-5-24 11:25


J大,這兩個網址從原先的網頁代碼能看出來嗎?
巨集內還有一段下載個股日成交資訊,還有我也想從櫃買中心下載上櫃資料,
也面臨相同問題


上市個股日成交資訊
http://www.tse.com.tw/zh/page/trading/exchange/STOCK_DAY.html
上櫃每日收盤網址
上櫃個股日成交網址

TOP

回復  t8899 不是每個網頁都可以 指定表格下載,有的頁面只能全頁下載
joey0415 發表於 2017-5-24 20:28


請教這個怎麼抓呢?
http://www.twse.com.tw/zh/page/trading/fund/T86.html

TOP

TOP

TOP

回復 15# joey0415
太感謝了,J大
還有一個網址,能幫忙看看嗎?
http://www.tse.com.tw/zh/page/trading/exchange/STOCK_DAY.html

ps. 若要像您一樣能看得出抓取網址,是要能看懂java嗎?

TOP

TOP

網址有了

自己練習看看
joey0415 發表於 2017-5-24 21:35


Sub Macro1()
Cells.Clear
ddd = "URL;http://www.twse.com.tw/fund/T86?response=html&date=" & Format(Date, "yyyyMMDD") & "&selectType=ALL"
With ActiveSheet.QueryTables.Add(Connection:=ddd, Destination:=Range("$A$1"))
.Refresh BackgroundQuery:=False
End With
End Sub

TOP

回復 17# joey0415


    您好,我也很好奇,如何取得該網址?
    能否請 joey先進指點迷津
    感謝

JS

TOP

回復 5# joey0415


  謝謝  J大 已解決

TOP

        靜思自在 : 站在半路,比走到目標更辛苦。
返回列表 上一主題