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

§¹¦¨N¦¸¤U¸ü«á , ¤~·|¥X²{¶¥¬q¿ù»~91

§¹¦¨N¦¸¤U¸ü«á , ¤~·|¥X²{¶¥¬q¿ù»~91

¥»©«³Ì«á¥Ñ HSIEN6001 ©ó 2013-5-15 10:12 ½s¿è

§¹¦¨N¦¸¤U¸ü«á , ¤~·|¥X²{¶¥¬q¿ù»~91
½Ð°Ý§ÚÀ³¸Ó­×¥¿­þ¸Ì¡AÁÂÁÂ!!
  1. Sub CashFlow(°]³ø§O, fileIdx As String)
  2. Dim IE As New InternetExplorer

  3.     Select Case °]³ø§O
  4.         Case "©u³ø":     µ{¦¡ = "Cash_Q.aspx"
  5.         Case "¦~³ø":     µ{¦¡ = "Cash.aspx"
  6.     End Select
  7.    
  8.     ¼g¤J¤u§@ªí = °]³ø§O
  9.    
  10. IE.Visible = False
  11.     UL = "http://2330.tw/Stock_" & µ{¦¡ & "?id=" & fileIdx
  12.     IE.navigate UL
  13.         Do While IE.readyState <> READYSTATE_COMPLETE
  14.             DoEvents
  15.         Loop
  16.     Set oDoc = IE.document
  17.         Call ListTableinnertext(oDoc)
  18.         '
  19.         '
  20.         '
  21. Set oDoc = Nothing
  22. End Sub

  23. Sub ListTableinnertext(oDoc)
  24. Dim DocElemsCnt As Integer
  25. Dim Tbl As Object
  26. Dim CoLen As Integer, RwLen As Integer
  27. Dim iText As String
  28.     For DocElemsCnt = 0 To oDoc.all.Length - 1
  29.         If oDoc.all.Item(DocElemsCnt).tagName = "TABLE" Then    '°õ¦æ§¹¦¨ N ¦¸¤U¸ü«á,¨C¦¸³£¦b³o¦æ¥X²{¶¥¬q¿ù»~91
  30.             Set Tbl = oDoc.all.Item(DocElemsCnt)
  31.             If Tbl.Rows.Length > 5 Then
  32.                 rCol = 0
  33.                 For RwLen = 0 To Tbl.Rows.Length - 1
  34.                     rCol = rCol + 1
  35.                     For CoLen = 0 To Tbl.Rows(RwLen).Cells.Length - 1
  36.                         iText = Tbl.Rows(RwLen).Cells(CoLen).innerText
  37.                         If Left(iText, 4) = "Page" Then Exit Sub
  38.                         Cells(RwLen + 1, CoLen + 4).Value = iText
  39.                     Next CoLen
  40.                 Next RwLen
  41.             End If
  42.         End If
  43.     Next DocElemsCnt
  44. End Sub
½Æ»s¥N½X

¥»©«³Ì«á¥Ñ GBKEE ©ó 2013-5-15 10:44 ½s¿è

¦^´_ 1# HSIEN6001
  1.     Set oDoc = IE.document
  2.         Call ListTableinnertext(oDoc)
  3.         '
  4.         '
  5.         '
  6. Set oDoc = Nothing
  7. IE.Quit     ' Ãö³¬¥¦: ¥i´î¤Ö¨Ï¥Î°O¾Ð¸Ì
  8. End Sub
½Æ»s¥N½X
  1.    On Error Resume Next    'µ{¦¡¦³¿ù»~,Ä~Äò°õ¦æµ{¦¡.
  2.     For DocElemsCnt = 0 To oDoc.all.Length - 1
  3.         If oDoc.all.Item(DocElemsCnt).tagName = "TABLE" Then    '°õ¦æ§¹¦¨ N ¦¸¤U¸ü«á,¨C¦¸³£¦b³o¦æ¥X²{¶¥¬q¿ù»~91
½Æ»s¥N½X
·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