f101f101 wrote:
樓主好 股權結...(恕刪)
改下列兩行table 後的數字
stockname = HTMLsourcecode.all.tags("table")(6).Rows(0).innertext
Set Table = HTMLsourcecode.all.tags("table")(7).Rows
順便問樓主,以下code執行兩次, 可以把.responsetext 加到同一個htmlfile中,之後才一次一起分析資料嗎?
With CreateObject("WinHttp.WinHttpRequest.5.1")
urla = "http://mis.twse.com.tw/stock/api/getStockInfo.jsp?ex_ch=otc_o00.tw|otc_GTSM50.tw|otc_GTHD.tw|otc_EMP88.tw|otc_GTCI.tw|otc_TPCGI.tw|otc_GAME.tw|otc_o13.tw|otc_o04.tw|otc_o05.tw|otc_o21.tw|otc_o22.tw|otc_o10.tw|otc_o24.tw|otc_o25.tw|otc_o26.tw|otc_o27.tw|otc_o28.tw|otc_o29.tw|otc_o30.tw|otc_o31.tw|otc_o32.tw|otc_o14.tw|otc_o15.tw|otc_o16.tw|otc_o20.tw|otc_TWTBI.tw|&json=1&delay=0&_="
urlb = "http://mis.twse.com.tw/stock/api/getStockInfo.jsp?ex_ch=tse_t00.tw|tse_TW50.tw|tse_TWMC.tw|tse_TWIT.tw|tse_TWEI.tw|tse_TWDP.tw|tse_EMP99.tw|tse_HC100.tw|tse_CG100.tw|tse_FRMSA.tw|tse_t001.tw|tse_t002.tw|tse_t003.tw|tse_SC300.tw|tse_DVA150.tw|tse_DVA100.tw|tse_BC30.tw|tse_INE30.tw|tse_ITE30.tw|tse_LV30.tw|tse_LB100.tw|tse_SMC50.tw|tse_SAM50.tw|tse_BC30-1.tw|tse_t011.tw|tse_t031.tw|tse_t051.tw|tse_t01.tw|tse_t02.tw|tse_t03.tw|tse_t04.tw|tse_t05.tw|tse_t06.tw|tse_t07.tw|tse_t21.tw|tse_t22.tw|tse_t08.tw|tse_t09.tw|tse_t10.tw|tse_t11.tw|tse_t12.tw|tse_t13.tw|tse_t24.tw|tse_t25.tw|tse_t26.tw|tse_t27.tw|tse_t28.tw|tse_t29.tw|tse_t30.tw|tse_t31.tw|tse_t14.tw|tse_t15.tw|tse_t16.tw|tse_t17.tw|tse_t18.tw|tse_t23.tw|tse_t20.tw|tse_TTDRL2.tw|tse_TTDRIN.tw|tse_EDRL2.tw|tse_EDRIN.tw|tse_FDRL2.tw|tse_FDRIN.tw|&json=1&delay=0&_="
Url = Choose(j, urla, urlb)
.Open "GET", "http://mis.twse.com.tw/stock/group.jsp?ind=OIDX&ex=otc&currPage=0&type=fixed", False
.send
.Open "GET", Url & UNIXTime, False
.setRequestHeader "Referer", "http://mis.twse.com.tw/stock/group.jsp?ind=OIDX&ex=otc&currPage=0&type=fixed"
.setRequestHeader "Cache-Control", "no-cache"
.setRequestHeader "Pragma", "no-cache"
.setRequestHeader "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"
.send