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

[µo°Ý] ¦³Ãö©ó¼´ªÑ²¼Code°ÝÃD

¦^´_ 9# afu9240

°Ú§Úª¾¹D±zªº·N«ä¤F
¦]¬°¦b¥Î³o¤èªk§ì¸ê®Æ®É¡A¥L·|¦³¤@­Ó¹³¬O"°O¾Ð"ªº¥\¯à(½T¤Áªº±M¦³¦Wµü§Ú¤£¤Ó²M·¡)
¤]´N¬O»¡­Yµo°eªº¬O¦P¤@­Órequest¡A¨º¥L´N·|®³¨ì¸ò¤W¦¸¤@¼Ëªº¸ê®Æ(³o¤]¬O¬°¤°»ò·í§A¦b°õ¦æ²Ä¤G¦¸¡B²Ä¤T¦¸µ{¦¡®É¡A¥L·|°õ¦æªº¶W§Ö)
©Ò¥H¸Ñ¨M¤è¦¡´N¬O"Åý¥Lµo°e¤£¤@¼Ëªºrequest"
¨Ò¦p¦b°Ñ¼Æ¦h¥[¤@­Ótimer¡A¨C¦¸µo°eªº®É­Ô¥L´N·|¥H¬°¬O¤£¤@¼Ëªºrequest¤F¡A¦ý¹ê»Ú¤W³o­Ótimer¨Ã¤£·|¼vÅT¨ì§A§ì¨ìªº¸ê®Æ
·PÁ±z¤SÅý§Ú¤W¤FÄ_¶Qªº¤@½Ò
  1. Sub test()

  2. Dim myXML As Object
  3. Set myXML = CreateObject("Microsoft.XMLHTTP")

  4. Dim myHTML As Object
  5. Set myHTML = CreateObject("HTMLFile")


  6. i = 2
  7. With myXML
  8.     For Each stockNo In Range("A2:A4").Value
  9.         .Open "GET", "https://tw.stock.yahoo.com/q/q?t=" & Timer & "&s=" & stockNo, False
  10.         .send
  11.    
  12.         myHTML.body.innerHTML = .responseText
  13.         
  14.         Set myTable = myHTML.getElementsByTagName("table")(6)
  15.         
  16.         For j = 1 To 10
  17.             Cells(i, j + 1) = myTable.Rows(1).Cells(j).innerText
  18.         Next
  19.         
  20.         i = i + 1
  21.     Next
  22. End With

  23. Set myXML = Nothing
  24. Set myHTML = Nothing

  25. End Sub
½Æ»s¥N½X
Excel VBAºô­¶¸ê®Æ¦¬¶°±Ð¾Ç:
http://forum.twbts.com/thread-20848-1-1.html

TOP

http://forum.twbts.com/thread-20755-1-1.html
¦Û³Ðªº °e§A¨Ï¥Î¤£¥Î«È®ð

TOP

¦^´_ 9# afu9240

©Ò¥H...½Ð°Ý³Ì«á¦³¸Ñ¨M±zªº°ÝÃD¶Ü?
Excel VBAºô­¶¸ê®Æ¦¬¶°±Ð¾Ç:
http://forum.twbts.com/thread-20848-1-1.html

TOP

¦^´_ 13# iamaraymond


    «D±`·PÁÂi¤jªº¨ó§U¡C¡C¥i¥Hwork¤F¡C¡C¯uªº¤Ó·PÁ¤F
yvonne

TOP

TOP

¦^´_ 11# iamaraymond


    i ¤j§A¦n,·Q½Ð±Ð¤@¤Uªþ¥ó¬O±z¤§«e´£¨Ñµ¹§Úªºcode ·sÀ£ÁY (zipped) ¸ê®Æ§¨.zip (15.03 KB) ,¤§«e³o­Ócode³£¯à¥¿±`¹B§@,½Ð°Ý²{¦bµLªkwork..ÅܼƤÎwith³£¦³³]©w,¬°¦óÁÙ¬O¦³°ÝÃD©O~~¨D¨ó§U
yvonne

TOP

Set myTable = myHTML.getElementsByTagName("table")(6)
§ï¦¨
Set myTable = myHTML.getElementsByTagName("table")(5)

TOP

¦^´_ 17# f3202

f¤j  ¦n¼F®` ¯uªº«D±`·PÁ±zªº¦^ÂÐ~~tks*100000

f¤j ½Ð°Ý(6)¸ò(5)¬O®t¦b­þ¸Ì°Ú??¥i¥H¸Ñ´b¤@¤U¶Ü??? ·PÁ°ª¤â
yvonne

TOP

¦^´_ 18# afu9240


    "https://tw.stock.yahoo.com/q/q?t=" & Timer & "&s=" & stockNo"
    ³o­Óºô­¶§ïª©¤F¡A¸ê®Æªí±q²Ä6§ï¨ì²Ä5

TOP

¦^´_ 19# Scott090


    ­ì¨Ó¦p¦¹~ÁÂÁÂ
yvonne

TOP

        ÀR«ä¦Û¦b : ªY½à§O¤H´N¬O²øÄY¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD