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

[µo°Ý] Web§ó·sºô­¶¡A·|¶]¥X 2²Õ¥X¨Ó (¶À¦â)

[µo°Ý] Web§ó·sºô­¶¡A·|¶]¥X 2²Õ¥X¨Ó (¶À¦â)

½Ð±Ð
Web§ó·sºô­¶¡A·|¶]¥X 2²Õ¥X¨Ó (¶À¦â)
1.¸Ó ¦p¦ó¸Ñ¨M³B²z~
2.¥i¥H ¦p¦ó²¤Æ...
·PÁÂ

VB ºCºC..¾Ç²ß¤¤



test-023.rar (21.58 KB)
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

¦^´_ 1# 7777

ªì¨B§P©w¡A
´Nºâ¤â°Ê¥þ¿ï½Æ»s¤@¼Ë·|¥X²{¦P¼Ëªº°ÝÃD¡A
«Øij±Ä¥ÎÃöÁä¦r½Æ»s­ì©l¤å¥»¡A
(¥i°Ñ¦Ò¤@¨Çª¦ÂΤ峹)

¼È®É¥ýÀ°¨ì³o¡A
µ¥¦³ªÅ§Ú¦A¨Ó¬ã¨s¬ã¨s XD

TOP

¦^´_ 1# 7777
  1. Sub Future()

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

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

  6. ReDim myArr(1 To 55, 1 To 15)

  7. With myXML
  8.     .Open "GET", "http://info512.taifex.com.tw/Future/FusaQuote_Norl.aspx?t=" & Timer, False
  9.     .send
  10.     myHTML.body.innerHTML = .responseText
  11.     Set myTable = myHTML.getElementByID("ctl00_ContentPlaceHolder1_uc_DgFusaQuote1_dgData")
  12.     i = 1
  13.     For Each myRow In myTable.Rows
  14.         j = 1
  15.         For Each myCell In myRow.Cells
  16.             myArr(i, j) = myCell.innerText
  17.             j = j + 1
  18.         Next
  19.         i = i + 1
  20.     Next
  21. End With

  22. Range("A5").Resize(55, 15).Value = myArr

  23. Set myXML = Nothing
  24. Erase myArr
  25. End Sub
  26. Sub Opt()

  27. Dim myXML As Object
  28. Set myXML = CreateObject("Microsoft.XMLHTTP")

  29. Dim myHTML As Object
  30. Set myHTML = CreateObject("HTMLFile")

  31. ReDim myArr(1 To 30, 1 To 13)

  32. With myXML
  33.     .Open "GET", "http://info512.taifex.com.tw/Future/OptQuote_Norl.aspx?t=" & Timer, False
  34.     .send
  35.     myHTML.body.innerHTML = .responseText
  36.     Set myTable = myHTML.getElementByID("ctl00_ContentPlaceHolder1_uc_DgOptQuote1_UpdatePanel1").getElementsByTagName("table")(0)
  37.     i = 1
  38.     For Each myRow In myTable.Rows
  39.         j = 1
  40.         For Each myCell In myRow.Cells
  41.             myArr(i, j) = myCell.innerText
  42.             j = j + 1
  43.         Next
  44.         i = i + 1
  45.     Next
  46. End With

  47. Range("R5").Resize(30, 13).Value = myArr

  48. Set myXML = Nothing
  49. Erase myArr
  50. End Sub
½Æ»s¥N½X
Excel VBAºô­¶¸ê®Æ¦¬¶°±Ð¾Ç:
http://forum.twbts.com/thread-20848-1-1.html

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2018-9-5 15:23 ½s¿è

¦^´_ 1# 7777
  1. Option Explicit
  2. Sub EX_ºô­¶()
  3.     Dim oXmlhttp As Object, oHtmldoc As Object, E As Object, R As Integer, C As Integer
  4.     Dim I As Integer, AR(1 To 2)
  5.     AR(1) = "http://info512.taifex.com.tw/Future/FusaQuote_Norl.aspx"
  6.     AR(2) = "http://info512.taifex.com.tw/Future/OptQuote_Norl.aspx"
  7.     Cells.Clear
  8.     For I = 1 To 2
  9.         Set oXmlhttp = CreateObject("msxml2.xmlhttp")
  10.         Set oHtmldoc = CreateObject("htmlfile")
  11.         With oXmlhttp
  12.             .Open "Get", AR(I), False
  13.             .send
  14.             oHtmldoc.write .responseText
  15.         End With
  16.         Set E = oHtmldoc.all.tags("TABLE")( 12))
  17.         For R = 0 To E.Rows.Length - 1
  18.             For C = 0 To E.Rows(R).Cells.Length - 1
  19.                 With IIf(I = 1, [A26], [T26])
  20.                 .Cells(R + 1, C + 1) = E.Rows(R).Cells(C).innerText
  21.                 End With
  22.             Next
  23.         Next
  24.         Set oXmlhttp = Nothing
  25.         Set oHtmldoc = Nothing
  26.     Next
  27. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 4# GBKEE


ÁÂÁ¶W¯ÅªO¥Dªº¤À¨É¡I
¦]¬°¦³§A­Ì¼ö¤ßªº¤À¨É¡A
¤~¯àÅý§Ú­Ì³o¨Ç«á½ú¥i¥H¶}²´¬É~  : )

TOP

¦^´_ 3# iamaraymond

·PÁÂ
Raymond Chien ªº¤j¤OÀ°¦£
µ{¦¡OK
¥»¤H¦A¬ã¨s¾Ç²ß¤¤¡A
¶W¯Å·PÁÂ~~¼ö¤ßªºÀ°¦£¡C
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

¦^´_ 4# GBKEE

ÁÂÁ GBKEE ªº¤À¨É¡I
µ{¦¡OK

Set E = oHtmldoc.all.tags("TABLE")( 12))
¦h¤F ¤@­Ó ")"

·PÁÂ
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

        ÀR«ä¦Û¦b : ¤Hªº²´·úªø¦b«e­±¡A¥u¬Ý¨ì§O¤Hªº¯ÊÂI¡Aµ·²@¬Ý¤£¨ì¦Û¤vªº¯ÊÂI¡C
ªð¦^¦Cªí ¤W¤@¥DÃD