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

[µo°Ý]VBA§ì¨ú.PHP­¶°ÝÃD??

[µo°Ý]VBA§ì¨ú.PHP­¶°ÝÃD??

¦U¦ì¥ý¶i
              ¤£¤~¦bºô¸ô¤W¬Ý¨ì¤@¬q§ì¨úÂd¶R.phpªº¸ê®Æ,­ì¤å¦p¤U
   
Sub Macro1()
    Dim i As Integer, j As Integer, k As Integer
URL$ = "http://www.gretai.org.tw/ch/stock/statistics/monthly/st42.php"
    With CreateObject("InternetExplorer.Application")
        .Visible = True
        .Navigate URL
        Do While .Busy Or .ReadyState <> 4: DoEvents: Loop
        .Document.all("input_stock_code").Value = 6121 '­n¬dªº¥N½X
        .Document.all(1758).Click    <=====¥¨¶°°õ¦æ¨ì¦¹´N¿ù»~,½Ð°Ý³o¤@¦æ¬O¬°¦ó·N,§ä¤F«Ü¤[¬d¤£¥X¬O¦ó·N
        Application.Wait Now + TimeValue("00:00:02") 'µ¥«Ý2¬í§ó·s¸ê®Æ
        Set tmp = .Document.getelementsbytagname("table")(79) <==== (79)¤S¬O¦ó·N??
        k = 1
        Cells(k, 1) = tmp.Rows(0).innertext
        Cells(k, 1).WrapText = False
        For i = 1 To tmp.Rows.Length - 1
            k = k + 1
            For j = 0 To tmp.Rows(i).all.Length - 1
                Cells(k, j + 1) = tmp.Rows(i).Cells(j).innertext
            Next
        Next
        k = k + 1
        Set tmp = .Document.getelementsbytagname("table")(82)<==== (82)¤S¬O¦ó·N??
        For i = 0 To tmp.Rows.Length - 1
            k = k + 1
            For j = 0 To tmp.Rows(i).all.Length - 1
                Cells(k, j + 1) = tmp.Rows(i).Cells(j).innertext
            Next
       ¦]­ìºô­¶´N¦b¿é¤J 6121 ´N°±¦í¤F,¥¼¯àIJµoºô­¶±a¥X¸ê®Æ,¬G«áÄòªº table ´NµLªk§ì¥X¼Æ¾Ú±a¤Jexecl,½Ð°Ý¥ý¶i»Ý¦p¦ó­×§ï¤~¦n..TKS!!

·PÁ Hsieh ¤j¤j ¨ó§U¸Ñ¨M,ªì¨B´ú¸Õ§ì¨ì¤F..

          kn = n.Value    <==¦A½Ð±Ð³o¦æ¬O¦ó·N,VBA «O¯d¦r¶Ü??
         ¨ä¥¦¤j·§¬ÝªºÀ´.....

TOP

¦^´_ 5# tsuneng


    .Document.all("input_stock_code").Value = 6121  <--- stockscode$
     cells(1, 1) = stockcode$

TOP

¦^´_ 7# tsuneng


    µª®×³£¤w¦^µª¤F!!¦pªGÁÙ¬O·Q¤£³Ò¦ÓÀò,¨º´N¦³¤T½u¤F.:Q

TOP

¦^´_ 10# tsuneng


    §Ú¤]±µªñ4¦~¯Å°Ú!!³o¬O§Aªº»¡ªk§a!!

TOP

        ÀR«ä¦Û¦b : ¥ÌÄ@°µ¡BÅw³ß¨ü¡C
ªð¦^¦Cªí ¤W¤@¥DÃD