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

ªÑ»ù¥N¸¹©M°_©l¤é´Áªº§ì¨ú

ªÑ»ù¥N¸¹©M°_©l¤é´Áªº§ì¨ú

¦U¦ì¦Ñ®v§A¦n

http://www.cnyes.com/twstock/ps_historyprice/1101.htm

§Ú·Q§ì¨ú¤W­zºô­¶ªº¸ê®Æ,µL©`ºô§}¥u¦³¨q¥XªÑ»ù¥N¸¹

¦ý¬Oºô­¶¤¤ªº°_©l¤é§Ú·Q¦Û¤v³]©w,ºô­¶¤¤ªº­ì©l½X§Ú¬Ý¤£¸³

©Ò¥H,µL±q§ì¨ú¥Lªºurl½Ð°ª¤âÀ°¦£¿ò¤U

·P®¦

·PÁÂgbk frankchen7 ¨â¦ì«e¤H¤À¨É
¾Ç²ß¤¤~

TOP

¦^´_ 22# frankchen7
ÁÂÁÂGBKEEª©¤jªº´£¥Ü¡A§Ú­×§ï¦¨¤U­±ªº¤è¦¡¤w¥i¥¿±`§ì¨ú
Sub ¹d¦ëºô_¾ú¥v¦æ±¡()
    Dim Sh As Worksheet, Code As String, d_Start As String, d_End  As String
    Dim A As Object, i As Integer, c As Integer, T As Date
    Code = InputBox("¿é¤JªÑ²¼¥N¸¹:", "ªÑ²¼¥N¸¹", 2303)
    d_End = InputBox("¿é¤Jµ²§ô¤é´Á", "µ²§ô¤é´Á", Date)
    If Len(Code) <= 3 Or Not IsDate(d_End) Then Exit Sub
    Set Sh = ActiveSheet
    With Sh
        .UsedRange.Clear
        .[a1] = "ªÑ²¼¥N½X"
        .[b1] = "°_©l¤é´Á"
        .[c1] = "µ²§ô¤é´Á"
        .[a2] = Code
        .[b2] = DateAdd("yyyy", -3, d_End)  '¤U¸ü¤T¦~ªº¾ú¥vªÑ»ù
        .[c2] = d_End
        Code = .[a2]
        d_Start = Format(.[b2], "yyyy/mm/dd")
        d_End = Format(.[c2], "yyyy/mm/dd")
    End With
    With CreateObject("InternetExplorer.application")
        .Navigate "http://www.cnyes.com/twstock/ps_historyprice/" & Code & ".htm"
        .Visible = True
        Application.StatusBar = Code & "¾ú¥v¦æ±¡ µ¥­Ô¤¤..."
        Do While .Busy Or .readyState <> 4
             DoEvents
        Loop
            With .Document
               .all("code").Value = Code '¶ñ¤J¥N½X (¤£»Ý­n¦h¾lªº)
               .all("ctl00$ContentPlaceHolder1$startText").Value = d_Start '¶ñ¤J°_©l®É¶¡
               .all("ctl00$ContentPlaceHolder1$endText").Value = d_End '¶ñ¤Jµ²§ô®É¶¡
               For Each E In .GetElementsByName("ctl00$ContentPlaceHolder1$submitBut")
               If E.Value = "¬d¸ß" Then E.Click '°e¥X¬d¸ßÁä
               Next
            End With

        T = TIME
        Do
            DoEvents
        Loop Until TIME > T + #12:00:08 AM#
        Set A = .Document.GetElementsByTagName("table")(1)
        Application.StatusBar = Code & "¾ú¥v¦æ±¡ ¤U¸ü¤¤..."
        Cells(2, 1) = .Document.GetElementsByTagName("span")(79).innertext
        For i = 0 To A.Rows.Length - 1
            For c = 0 To A.Rows(i).Cells.Length - 1
                Sh.Cells(i + 3, c + 1) = A.Rows(i).Cells(c).innertext
            Next
'        .Navigate "http://forum.twbts.com/tag.php?name=ºô­¶¤¸¯À"
'       .Visible = True
        
        Next
       .Quit
    End With
    Application.StatusBar = Code & "¾ú¥v¦æ±¡" & Application.Text(TIME - T, "[S] ¬í") & "¤U¸ü§¹¦¨"
    MsgBox "OK"
    Application.StatusBar = False
End Sub
:D

TOP

[ª©¥DºÞ²z¯d¨¥]
  • GBKEE(2016/4/26 10:50): http://forum.twbts.com/tag.php?name=ºô­¶¤¸¯À

¦^´_ 4# GBKEE

Hello GBKEEª©¤j±z¦n¡A¥Ø«e¤W­z¤è¦¡¤wµLªkÂ^¨ú¤T¦~ªº¸ê°T¤F¡A§ÚÀ³¸Ó¦p¦ó½T»{­n­×§ï¨º¨Ç°Ñ¼Æ?
§Ú±qºô­¶­ì©l½X¤¤§ä¨ì»P°_©l¤é´Á¦³Ãöªº¸ê°T¦p¤U¡A¦ýÁÙ¬O¤£ª¾¹D¸Ó¦p¦ó¶ñ¤J:L
<script type="text/javascript" charset="utf-8">
        $(document).ready(
            function(){
                    addDatePicker();               
            }
        );
        function addDatePicker()
        {
            jQuery(
                    function($){
                                $("#ctl00_ContentPlaceHolder1_startText").datepicker();
                                $("#ctl00_ContentPlaceHolder1_endText").datepicker();
                        });       
                       
                        $("#ctl00_ContentPlaceHolder1_startText").keypress(function(){
                            return false;
                        }).datepicker();
            $("#ctl00_ContentPlaceHolder1_endText").keypress(function(){
                            return false;
                        }).datepicker();
        }
</script>

TOP

[ª©¥DºÞ²z¯d¨¥]
  • GBKEE(2016/4/26 10:49): 11 ©«ªºµ{¦¡½X¤w§ó·s

¦^´_ 11# GBKEE


¶Wª©¤j,§A¦n
       ½Ð°Ý§Ú¨Ï¥Î§ì¥h¦~ªº"¹d¦ëºô_¸³ºÊ«ùªÑ"³£¨S°ÝÃD,¦ý¥Ø«e¦³¤G­Ó°ÝÃD½Ð¶Wª©¤j¸Ñ´b,ÁÂÁÂ.
1.) ¤@¦¸§ì2013¦~9¤ë¨ì2014¦~2¤ë´N·|ª½±µ§ì¨ì2014¦~2¤ëªº¸ê®Æ.
2.) RUNªº¹Lµ{,¦³®É·|¥X²{"Automation¿ù»~"

¥¼©R¦W.jpg (102.81 KB)

¥¼©R¦W.jpg

¥¼©R¦W.2.jpg (18.51 KB)

¥¼©R¦W.2.jpg

VBA-¸³ºÊ..test.zip (15.54 KB)

¥Î²³æªº¤ß°µ½ÆÂøªº¨Æ

TOP

¦^´_ 19# yopoyuan
±N§Aªºµo°Ý¦X¨Ö¦b[«ü©w¤U¸ü3¦~¾ú¥vªÑ»ùªº¸ê®Æ] ,½Ð±q²Ä1©«¬Ý°_.
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 17# c_c_lai

ÁÂÁ¤j¤j±zªº¦^Âгᠠ·P®¦ ·P®¦

TOP

¦^´_ 16# omit
ºô¯¸¤W¦³«Ü¦h¦³Ãö¦¹Ãþªº½×­z¡AÄ´¦p¡G
http://forum.twbts.com/viewthread.php?tid=6706&extra=&page=1

TOP

¶W¯Åª©¥D ±z¦n
§Ú·Q½Ð°Ý¤@­Ó°ÝÃD:
§Ú¦³¤@µ§¶×¾ã¸ê®Æ ¸ê®Æ ¥ÑA2:Z2, A2¬OÅã¥Ü¤é´Á»P®É¶¡, B2:Z2¬OÅܼƪº­È
§Ú¦b¦P¤@­Ó SHEET§ì¨ú¸ê®Æ ¨C¹j5ÄÁ¥Î½Æ»s,¿ï¾Ü©Ê¶K(­È)¤W ¨ì A5:Z5°µ¦¨¤@µ§·s¸ê®Æ
µM«á ¤U¤@¦¸ ¤â°Ê A6:Z6¦A¶K¤W¤@¦¸~~¦b¤U¤@¦¸ A7:Z7 ,¦ýı±o«Ü¤£¤è«K
(¥i¬O¥Î¥¨¶°¿ý»sµLªk§ó§ï®É¶¡ÅܤÆ)
§Ú·Q¼g VBA ¥i¥H¨C¶¡¹j5¤ÀÄÁ¦Û°Ê§ó·s¤@¦¸¤§«á,´N§ì¨ú³o¤@µ§¸ê®Æ µM«á ¥i¥H¦Û°Ê§ì¨ú30¦¸
¤£ª¾¦p¦ó°µ,¥i½Ðª©¥D¸Ñ´b¤@¤U....ÁÙ¦b¾ÇVBAªº»yªk¤¤.....@@

TOP

¦^´_ 14# omit
§A¥i¸Õ¸Õ¬Ý,¦p¤£¦æ¥i¤W¶ÇÀɮ׬ݬÝ
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ¡i®É¶¡µLªk¾B¾×¡j©È®É¶¡®ø³u¡Aªá¤F³\¦h¤ß¦å¡A·QºÉ¦U¦¡¤èªk­n¾B¾×®É¶¡¡Aµ²ªG¬O¡G®ö¶O¤F§ó¦h®É¶¡¡A¥B¤@µL©Ò¦¨¡I
ªð¦^¦Cªí ¤W¤@¥DÃD