- ©«¤l
- 1018
- ¥DÃD
- 15
- ºëµØ
- 0
- ¿n¤À
- 1058
- ÂI¦W
- 0
- §@·~¨t²Î
- win7 32bit
- ³nÅ骩¥»
- Office 2016 64-bit
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ®ç¶é
- µù¥U®É¶¡
- 2012-5-9
- ³Ì«áµn¿ý
- 2022-9-28
|
¦^´_ 20# c_c_lai
¥i¥Hµy·L°Ñ¦Ò³o©« : http://forum.twbts.com/viewthread.php?tid=15544- Sub Test()
- Dim xTable As Object, k As Integer, C As Integer, R As Integer ' , sn As Integer
- Dim url As String, cts As Integer, E As Variant, xDate As String ' , rc As Integer
- Dim oXmlhttp As Object, oHtmldoc As Object, select2 As String ' , tm
- Dim TVal() As Variant
- If Select_Name = -1 Then Exit Sub
- TVal = Array("MS", "ALL", "0049", "0099P", "019919T", "0999", "0999P", "01", "02", "03", _
- "04", "05", "06", "07", "21", "22", "08", "09", "10", _
- "11", "12", "13", "24", "25", "26", "27", "28", "29", _
- "30", "31", "14", "15", "16", "17", "18", "23", "9299", "19", "20", "CB")
- url = "http://www.twse.com.tw/ch/trading/exchange/MI_MARGN/MI_MARGN.php"
- xDate = Format(Sheets("Á`ªí").[B1], "EE/MM/DD")
- sPost = "qdate=" & Replace(xDate, "/", "%2F") & "&selectType=" & TVal(Select_Name) 'urlencode
- Set oXmlhttp = CreateObject("msxml2.xmlhttp")
- Set oHtmldoc = CreateObject("htmlfile")
- With oXmlhttp
- .Open "Post", url, False
- '.setRequestHeader "Connection", "Keep-Alive" 'µu®É¶¡¤º¦h¦¸¬d¸ß«Øij¥i¥[³o¦æ
- .setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
- .setRequestHeader "Content-Length", Len(sPost)
- .Send sPost
- '¤W± Open °Ñ¼Æ¥ÎFalse(=¦P¨B)¡A¥i¥H¤£¥Î¦A§PÂ_status
- 'Do While .Status <> 200 Or .readyState <> 4: DoEvents: Loop
- oHtmldoc.write .responseText
- 'MsgBox .responseText
- End With
- Set xTable = oHtmldoc.ALL.tags("TABLE")
- ' Stop
- ' ¬Ý¬Ý°Ï°ìÅܼƵøµ¡ xTable ªº¤º®e
- Set xTable = oHtmldoc.ALL.tags("TABLE")(0)
- ' Stop
- ' ¦A¦¸¬Ý¬Ý°Ï°ìÅܼƵøµ¡ xTable ªº¤º®e
- MsgBox xTable.INNERTEXT
- End Sub
½Æ»s¥N½X |
|