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

[µo°Ý] ¤U¸ü°ÝÃD

[µo°Ý] ¤U¸ü°ÝÃD

¥»©«³Ì«á¥Ñ spermbank ©ó 2013-9-6 10:32 ½s¿è

¤j®a¦n:
     §Ú·Q¤U¸ü¦pºô§}http://newmis.twse.com.tw/stock/fibest.jsp?stock=1101ªº³Ì¨Î¤­ÀÉ»ù¶q¸ê°T´¦¥Ü¡C
     ¦]¬°¨Ï¥Î¹Lexcel±qºô¯¸¨ú±o¥~³¡¸ê®Æªº¥\¯à¡A¦ý¬OµLªkŪ¨ú¡A¤£ª¾¹D¬O¤°»ò°ÝÃD¡C

    ©Ò¥H·Q»¡¬O§_¥i¥H¦b¤À­¶¿ï¨úªÑ¸¹¦WºÙ¡A±Ò°Ê¥¨¶°¡A¦A±q¦p¤Wºô§}±N¥Ø«e®É¶¡©Ò´¦¥Üªº³Ì¨Î¤­ÀÉ»ù¶q¸ê°T¡AÀx¦s¦¨csvÀÉ¡A¨Ã±N¶R¶i¡B½æ¥X¼Æ¶q¥[Á`¡AÅã¥Ü©ó¤À­¶¤¤©O?
    ÁÂÁ¡C

ÁÂÁ G¤j ªº±Ð¾É
^_^

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2013-9-13 21:17 ½s¿è

¦^´_ 13# spermbank
11#  http://www.excelpx.com/thread-149757-1-1.html

13# §A¥i¸Õ¸Õ¬Ý

12#
  ¶}±Ò¬d¸ßÀÉ
  1. WEB
  2. 1
  3. http://newmis.twse.com.tw/stock/fibest.jsp?stock=1101
  4. '************************
  5. Selection=hor-minimalist-a
  6. '*************************
  7. Formatting=None
  8. PreFormattedTextToColumns=True
  9. ConsecutiveDelimitersAsOne=True
  10. SingleBlockTextImport=False
  11. DisableDateRecognition=False
  12. DisableRedirections=False
½Æ»s¥N½X
  1. WEB
  2. 1
  3. http://forum.twbts.com/thread-10377-1-1.html
  4. '*****************
  5. Selection=23,24           ' ¶·´î 1 , 22,23  ½Ð¬Ý  http://forum.twbts.com/viewthread.php?tid=10389&pid=58549&page=5&extra=pageD1#pid58549
  6. '******************
  7. Formatting=None
  8. PreFormattedTextToColumns=True
  9. ConsecutiveDelimitersAsOne=True
  10. SingleBlockTextImport=False
  11. DisableDateRecognition=False
  12. DisableRedirections=False
½Æ»s¥N½X




·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 10# GBKEE


     G¤j¦A½Ð°Ý¤@¤U:
     ¦]¬°¤@¦¸¥u¯à¶}±Ò¤@­Óºô§}´N¥²¶·µ¥«Ý2¬í¡A¥i¤£¥i¥H¤@¦¸¶}±ÒX­Óºô§}¦Aµ¥«Ý2¬í©O?
     ³o¼Ë´N¥i¥H¤@¦¸¸Ñ¨MX­Ó¡A¥uªáB¬í¡C

TOP

³øºp
¦A½Ð°Ý¤j¤j
id hor-minimalist-a hor-minimalist-b
¬O­n¥ý¬Ý­ì©l¶Ü±oª¾¶Ü
¦p¦ó¥Î vba ±oª¾ºô­¶¤º¦³¦h¤Ö­Ó id
ÁÙ¦³¥u¥i±o¨ì table ªº id ¶Ü
ÁÂÁÂ ¤j¤j

TOP

½Ð°Ý ¤j¤j
.Busy Or .ReadyState <> 4:
¬O¤°»ò·N«ä¡Aª©¤W«Ü¦h
¤£¥i
<>6 , 7 ...
¶Ü¡A
ÁÂÁÂ

TOP

¦^´_ 9# spermbank
VBA ¨S¦³¦w¸Ë IE ªº»¡©ú
  1. Option Explicit
  2. Sub °ò¥»¥«ªp³ø¾Éºô¯¸()
  3.     Dim xlVbTable(1 To 2) As Object, R As Integer, C As Integer, i As Variant, Y As Integer
  4.    Sheets("¤u§@ªí3").Select
  5.    With CreateObject("InternetExplorer.Application")
  6.        ' .Visible = True
  7.        .Navigate "http://newmis.twse.com.tw/stock/fibest.jsp?stock=5490"
  8.         Do While .Busy Or .ReadyState <> 4: DoEvents: Loop
  9.         Application.Wait Now + TimeValue("00:00:02")   'IE¶}±Ò«á¦A¼È°±2¬íµ¥­Ô¤U¸üIE¸ê®Æ
  10.         Set xlVbTable(1) = .Document.getElementById("hor-minimalist-a")
  11.         Set xlVbTable(2) = .Document.getElementById("hor-minimalist-b")
  12.         On Error Resume Next
  13.         With ActiveSheet
  14.             .Cells.Clear
  15.             Y = 1
  16.             For i = 1 To 2
  17.                 For R = 0 To xlVbTable(i).Rows.Length - 1
  18.                     For C = 0 To xlVbTable(i).Rows(R).all.Length - 1
  19.                         .Cells(Y, C + 1) = xlVbTable(i).Rows(R).Cells(C).innertext
  20.                     Next
  21.                     Y = Y + 1
  22.                 Next
  23.             Next
  24.         End With
  25.        .Quit
  26.     End With
  27. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¥»©«³Ì«á¥Ñ spermbank ©ó 2013-9-6 15:13 ½s¿è

¦^´_ 7# GBKEE


G¤j±z¦n:
     ¤j·§´N¬O¦pªþ¥ó¨â±i¹Ï¤ù©Ò¥Ü(Ū¤£¨ìªº±¡ªp¤£¤@©w)¡C
     ¥t¥~ºô­¶·|¶]¥X¨Ó¯àÁôÂöÜ? ÁÂÁ¡C
     
     §ï¦¨¶}±Òºô­¶¦h2¬í¡A¯à°÷§¹¾ã½Æ»s¾÷²vÅÜ90%¥H¤W¡A¦ý¬O³t«×¤WºC2¬í¤]¤£¯à§¹¥þ¸Ñ¨M°ÝÃD¡C

1.PNG (8.15 KB)

1.PNG

2.PNG (9.47 KB)

2.PNG

TOP

½Ð°Ý G¤j
Busy Or ReadyState  getElementById ¬O InternetExplorer.Application ªºÄݩʶÜ
§Ú¥Î F1 §ä¤£¨ì
ÁÂÁÂ

TOP

¦^´_ 6# spermbank
§Aªºµ{¦¡½X¨S°ÝÃD
¥i¦A»¡©ú  ·|µo¥Í""µLªk¨C¦¸""¸ê®Æ§¹¥þ½Æ»s¦Ü¤À­¶ ¬O¤°»ò±¡§Î??
CreateObject("InternetExplorer.Application") ¬OMicroSoft ªº iexplore.exe
Google Chrome ¤£¾A¥Î
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ¡i°µ¤Hªº¶}©l¡j¨C¤@¤Ñ³£¬O¬G¤Hªº¶}©l¡A¨C¤@­Ó®É¨è³£¬O¦Û¤vªºÄµ±§¡C
ªð¦^¦Cªí ¤W¤@¥DÃD