ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¦p¦ó§ä¥XPost¬d¸ß¤èªk¤¤¦U¶µ PostText ÄÝ©Ê!!

[µo°Ý] ¦p¦ó§ä¥XPost¬d¸ß¤èªk¤¤¦U¶µ PostText ÄÝ©Ê!!

§Ú·Q±qÃÒ¥æ©Òªº"¤T¤jªk¤H¶R½æ¶W¤é³ø"Â^¨ú¸ê®Æ,¦p¥H¤Uºô§}:

http://www.twse.com.tw/ch/trading/fund/T86/T86.php

§Æ±æ¬O¯à°÷¥ÑEXCELªí®æ¤º¿é¤J¦p¦P¥H¤Wºô§}¤¤¿é¤Jªº¤Þ¼Æ:"¸ê®Æ¤é´Á"»P"¤ÀÃþ¶µ¥Ø"¨Ó§ó·sdata

µM¦Ó¦]¬°¦¹web¬d¸ß¤è¦¡¬O¥HPOST¤èªk,¦Ó«DGET,ª¦¤å¬Ý¥H«e«e½úªº¥Ü½d,¦ü¥G­nÀ˵øºô­¶­ì©l½X§ä¥X¬Û¹ï¤Þ¼Æ(PostText ),¦p¥H¤U¥Ü½d:

http://gb.twbts.com/index.php?topic=11774.8

µM¦Ó¦¹¨Ò¤lªº PostText = "ajax=true&yy=" & yy & "&mm=" & mm & "&input_stock_code=" & stock ¬O«ç»òª¾¹Dªº??

¦^Âk§Ú¥Ø«e·Q¬d¸ßªº¸ê®Æ³sµ²:"¤T¤jªk¤H¶R½æ¶W¤é³ø" http://www.twse.com.tw/ch/trading/fund/T86/T86.php

§Ú¤S¸Ó¦p¦ó«Øºc§Úªºµ{¦¡¶Ü??

·Ð½Ðª©¤Wªº°ª¤â¤j¤j­Ì«ü±Ð^^ ÁÂÁÂ!!

¦^´_ 1# ¬¡¤O¥R¨K
§Ú¬O¥Îchromeª½±µ¬Ý­ì©l½X§äªº


¤é´Á°Ñ¼Æ¬O  input_date , ¤ÀÃþ¶µ¥Ø°Ñ¼Æ¬O select2
§A¥i¥H¸Õ¬Ý¬Ýqueryºô§}¥Î¹³³o¼Ëªº®æ¦¡
http://www.twse.com.tw/ch/trading/fund/T86/T86.php&input_date=101/10/19&select2=13

¤ÀÃþ¶µ¥Ø©M¹ïÀ³ªº­È¦p¤U , ¥i¥H¥t«Ø¤@ªí´£¨Ñ¤U©Ô¿ï³æ

TOP

¦^´_ 1# ¬¡¤O¥R¨K
·s¶}¬¡­¶Ã¯ ´¡¤J¤@ªí³æ : ¥[¤J ¤T±±¨î¶µ WebBrowser1 , CommandButton1 , CommandButton2

°õ¦æªí³æ: 1) WebBrowser1¤¤: ¿ï¾Ü ¤é´Á ,¤ÀÃþ¶µ¥Ø ,«ö¤U¬d¸ß
                  2)«ö¤Uªí³æªºCommandButton1

ªí³æªºµ{¦¡½X
  1. Option Explicit
  2. Dim Sh As Worksheet, IE As Object
  3. Private Sub UserForm_Initialize()
  4.     Set Sh = ActiveSheet   '«ü©w¤u§@ªí: ¼g¤J¸ê®Æ
  5.     With WebBrowser1
  6.         .Navigate "http://www.twse.com.tw/ch/trading/fund/T86/T86.php"  '«ü©wºô§}
  7.         Do While .Busy = True
  8.         DoEvents
  9.         Loop
  10.     End With
  11.     Set IE = WebBrowser1.Document
  12. End Sub
  13. Private Sub CommandButton1_Click()   '¼g¤J¸ê®Æ
  14.     Dim i, k, j
  15.     Sh.UsedRange.Clear
  16.     On Error Resume Next
  17.     For i = 0 To IE.getElementsByTagName("table")(8).Rows.Length - 1
  18.         k = k + 1
  19.         For j = 0 To 13
  20.             Sh.Cells(k, j + 1) = IE.getElementsByTagName("table")(8).Rows(i).Cells(j).innerText
  21.         Next
  22.     Next
  23.     Sh.Columns.AutoFit
  24.     Sh.Range("A1").ColumnWidth = 15
  25. End Sub
  26. Private Sub CommandButton2_Click()  'µ²§ôµ{¦¡
  27.     Unload Me
  28. End Sub
½Æ»s¥N½X

TOP

¦^´_  ¬¡¤O¥R¨K
¤é´Á°Ñ¼Æ¬O  input_date , ¤ÀÃþ¶µ¥Ø°Ñ¼Æ¬O select2
§A¥i¥H¸Õ¬Ý¬Ýqueryºô§}¥Î¹³³o¼Ëªº®æ¦¡
http://www.twse.com.tw/ch/trading/fund/T86/T86.php&input_date=101/10/19&select2=13
...
stillfish00 µoªí©ó 2012-10-21 11:52


©êºp »¡¿ù¤F , ¤£¬Oqueryºô§} , À³¸Ó¬OpostText
¹³³o¼Ë¥h§ïÅܰѼÆ
    Dim selectDate As String, selectType As String
    selectDate = "101/10/19"
    selectType = "13"

    With QueryTables(1)
        .Connection = "URL;http://www.twse.com.tw/ch/trading/fund/T86/T86.php"
        .PreserveFormatting = False
        .WebSelectionType = xlSpecifiedTables
        .WebFormatting = xlWebFormattingNone
        .WebDisableDateRecognition = True
        .WebTables = "9"
        .PostText = "input_date=" & selectDate & "&select2=" & selectType
        .Refresh False
    End With

TOP

§ä¥XpostText,¥h§ïÅܰѼƪº¤è¦¡¹ï§Ú¨Ó»¡¤ñ¸ûª½±µ¤]¸û¯à²z¸Ñ~

ÁÂÁ GBKEE & stillfish00 ¨â¦ì°ª¤â^^

TOP

¦A½Ð°Ý¤@¤U,¦pªG¬O¥H stillfish00 ¤jªº¤èªk¨Ó»¡,¥H¤Uºô§}ªº¿ï¾Ü¶µ¥ØÁÙ¦³"¨Ì¶R½æ¶WªÑ¼Æ±Æ¦C"»P"¨ÌÃÒ¨é¥N¸¹±Æ¦C"

http://www.twse.com.tw/ch/trading/fund/T86/T86.php

¦p¦ó±N§ì¨ìªº¸ê®Æ§ó§ï¬°"¨ÌÃÒ¨é¥N¸¹±Æ¦C"?

TOP

¦^´_ 6# ¬¡¤O¥R¨K
sorting=by_stkno

TOP

¶â¶â!! ¤F¸Ñ^^

ÁÂÁÂ~

TOP

¦^´_ 3# GBKEE


ÁÂÁÂGª©¥Dªº¾É¤Þ   
¥Ø«eµ{«×ÁÙ¬O¥ý¥Î
"§ä¥XpostText,¥h§ïÅܰѼƪº¤è¦¡¤ñ¸û®e©ö²z¸Ñ"~
ÁÂÁÂ!!

TOP

        ÀR«ä¦Û¦b : §g¤l¥ß«í§Ó¡A¤p¤H«í¥ß§Ó¡C
ªð¦^¦Cªí ¤W¤@¥DÃD