¥Îpost¤èªk§ì¤WÂdӪѡA«o¥u¯à§ì¨ì®Ø¬[ªº¸ê®Æ
- ©«¤l
- 16
- ¥DÃD
- 10
- ºëµØ
- 0
- ¿n¤À
- 68
- ÂI¦W
- 0
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- 2003
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2015-2-26
- ³Ì«áµn¿ý
- 2021-10-4
|
¥Îpost¤èªk§ì¤WÂdӪѡA«o¥u¯à§ì¨ì®Ø¬[ªº¸ê®Æ
½Ð±Ð¦U¦ì¥ý¶i
¤£ª¾¬°¤°»ò¨Ï¥Îpost¤èªk§ì¤WÂd¸ê®Æ¡A«o¥u¯à§ì¨ì¤@¨Çªí®æ¼ÐÀYªº¸ê®Æ
ªí®æ¤ºªº¸ê®Æ§ì¤£¨ì
·PÁ¦U¦ì¥ý¶i
Dim starttime As Variant
Dim fountrow As Integer, col As Integer, row As Integer
starttime = Now()
Dim path As String, thePOSTdata, URL
Dim stockID As Integer
col = 0
row = 1
stockID = 1258
y = 105
Z = 12
URL = "http://www.tpex.org.tw/web/stock/aftertrading/daily_trading_info/st43.php" '?l=zh-tw"
Set XML = CreateObject("Microsoft.XMLHTTP")
Set Stream = CreateObject("ADODB.stream")
'l: zh -tw
'd:105/01
'stkno:2235
'_:1480605726849
'http://www.tpex.org.tw/web/stock/aftertrading/daily_trading_info/st43_result.php?l=zh-tw&d=105/09/01&stkno=2732&_=1480599462728
thePOSTdata = "l=zh-tw&d=" & y & "/" & Z & "&stkno=" & stockID & "&_=1480599462728"
XML.Open "POST", URL, 0
XML.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
XML.send thePOSTdata
With Stream
.Type = 1
.Mode = 3
.Open
.Write XML.ResponseBody
.Position = 0
.Type = 2
.Charset = "Big5"
ByteToText = .ReadText
'strText = XML.responseText
'MsgBox strText
MsgBox ByteToText
Dim arr() As String
arr = Split(ByteToText, Chr(10)) 'Chr(10)¥NªíEnterÁä¶Ü???
Dim processstring As String
For i = 0 To UBound(arr)
MsgBox arr(i)
processstring = Replace(arr(i), """,""", "^^")
'putdata = Split(arr(i), "^^")
putdata = Split(processstring, "^^")
For j = 0 To UBound(putdata)
Sheets(2).Cells(row, j + 1 + col).Select
Sheets(2).Cells(row, j + 1 + col).NumberFormatLocal = "@"
'¤u§@ªí1.Cells(i + 1, j + 1).Value = CStr(Replace(Replace(putdata(j), """", ""), "=", ""))
'MsgBox putdata(j)
ShowString = Replace(Trim(putdata(j)), ",", "")
ShowString = Replace(ShowString, """", "")
ShowString = Replace(ShowString, "=", "")
Sheets(2).Cells(row, j + 1 + col).Value = ShowString
Next j
row = row + 1
Next i
End With
ªþ¥ó¬°excelÀÉ®×
[attach]26068[/attach] |
-
-
§ì¤WÂd.zip
(20.12 KB)
|
|
|
|
|
|
- ©«¤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
|
¥»©«³Ì«á¥Ñ joey0415 ©ó 2016-12-11 18:33 ½s¿è
¦^´_ 1# tsunamix03
http://www.tpex.org.tw/web/stock/aftertrading/daily_trading_info/st43_result.php?l=zh-tw&d=105/12&stkno=3122
¬õ¦rªº¦a¤è¦Û¤v§ï§ï¡A³Ñ¤Uªº§Aªºµ{¦¡½X³£¯à¿ì¨ì¤~¬O
¥Î get ¤£¬O post
|
|
|
|
|
|
|