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

[µo°Ý] ½Ð±Ð ¦p¦ó¦bEXCELL¨ú±o¸Óºô¯¸¤§"§Y®É¦ô­p²b­È"

¦^´_ 30# yan2463

§Ú¦³¤U¸ü25¼ÓªºVBA,·Q¥H³o­ÓÀɮשµ¦ù
1.¦]»Ý­n«ö¶s¤~·|§ó·s,·Q½Ð°Ý¬O§_¦³¨C¤@¤À©Î¤Q¤ÀÄÁÀÉ®×¥i¦Û¦æ§ó·s
2.¦p­n¥Î«ö¶s§ó·s,¦p¦ó¤~¯à¦b¦bA¤u§@ªí§ó·s¶s,¦b¤u§@ªíB§ó·s
3.¹ïVBA¯uªº¤£¼ô,©Ò¥H¤£ª¾³o¼Ë°Ý¬O§_OK

TOP

¦^´_ 32# yan2463

³o°¦µ{¦¡¤£¾A¦X©w®É°õ¦æ¡A¦ýÁÙ¬O¶K¤W¨Óµ¹§A°Ñ¦Ò!!
  1. Option Explicit
  2. Public doneT As Boolean
  3. Sub Exnets123() '
  4.     Dim E As Object, tTime, tabtxt As String
  5.     With CreateObject("InternetExplorer.Application")
  6.         '.Visible = True 'False
  7.         .navigate "http://www.yuantaetfs.com/#/RtNav/Index"
  8.         Do While .Busy Or .readyState <> 4: DoEvents: Loop
  9.         Application.SendKeys "~", True   '«ö¤U¦P·NÁä
  10.         '.document.getElementsByTagName("button")(0).Click  '«ö¤U¦P·NÁä
  11.         tTime = Timer
  12.         Do
  13.             Set E = .document.getElementsByTagName("TABLE")(21)  '§ï(22)¤]¥i¡AE.all.Length="¼Æ¶q­n¸òµÛ§ï"
  14.             DoEvents
  15.             If Timer - tTime > 5 Then MsgBox "½Ð­×§ï E.all.Length =" & E.all.Length: Exit Do  '½T©wµL»~«á¥iÃö³¬
  16.         Loop Until Not E Is Nothing And E.all.Length = 415  '¼Æ¶q¥i¯à·|¤£¤Ó¤@¼Ë
  17.         tabtxt = .document.getElementsByTagName("TABLE")(21).outerHTML
  18.         tabtxt = Replace(tabtxt, "<span class=""ng-hide"" ng-show=""o.navFluct>0"">¡¶</span>", "")
  19.         tabtxt = Replace(tabtxt, "<span class=""ng-hide"" ng-show=""o.navFluct<0"">¡¿</span>", "")
  20.         tabtxt = Replace(tabtxt, "<span class=""ng-hide"" ng-show=""o.priceFluct>0"">¡¶</span>", "")
  21.         tabtxt = Replace(tabtxt, "<span class=""ng-hide"" ng-show=""o.priceFluct<0"">¡¿</span>", "")
  22.         .document.body.innerHTML = tabtxt
  23.         .ExecWB 17, 2       '  Select All
  24.         .ExecWB 12, 2       '  Copy selection
  25.         With ActiveSheet    ''­×§ï§A­n¶K¤Wªº¤u§@ªí
  26.             .Cells.Clear
  27.             .[a1].Select
  28.             .PasteSpecial 'NoHTMLFormatting:=True  '(¨ú®øµù¸Ñ¡A§ï¦¨¯Â¤å¦r¶K¤W)
  29.         End With
  30.         'Selection.Columns.AutoFit
  31.         .Quit        'Ãö³¬ºô­¶
  32.     End With
  33.     If doneT = True Then
  34.         Application.OnTime Time + #12:00:10 AM#, "Exnets123" '¶¡¹j¦h¤Ö®É¶¡¶}±Ò
  35.     End If
  36. End Sub
  37. Sub ¶}Ãö() '¥t³]«ö¶s
  38. doneT = IIf(doneT = True, False, True)  '¦Û¦æ­×§ï¾A¦Xªº¤è¦¡
  39. MsgBox IIf(doneT = True, "©w®É¶}±Ò", "©w®ÉÃö³¬") '¶}±Ò¦A¥h°õ¦æExnets123µ{¦¡´N¯à¶¡¹j°õ¦æ¡AÃö³¬´N¯à¨ú®ø¶¡¹j°õ¦æ
  40. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¤f»¡¦n¸Ü¡B¤ß·Q¦n·N¡B¨­¦æ¦n¨Æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD