- ©«¤l
- 23
- ¥DÃD
- 0
- ºëµØ
- 0
- ¿n¤À
- 73
- ÂI¦W
- 299
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- Office 2003
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2012-4-21
- ³Ì«áµn¿ý
- 2024-11-28
|
¦^´_ 46# lcctno
¬O³o¼Ë¶Ü- Option Explicit
- Sub Ex()
- Dim E As Object, AR(), i As Integer, o As Object, k As Integer
- AR = Array("http://www.yuantaetfs.com/#/RtNav/Index", "http://www.yuantaetfs.com/#/Home/Index")
- 'Ar = Array(ºô§}:§Y®É²bÈ,ºô§}:°ê¤º«ü¼Æ) ºô§}¸m¤J°}¦C
- ActiveSheet.UsedRange.Clear
- For i = 0 To 1
- With CreateObject("InternetExplorer.Application")
- .Visible = True
- .Navigate AR(i)
- Do While .Busy Or .readyState <> 4: DoEvents: Loop
- If i = 0 Then '°ê¤º«ü¼Æ:¤£»Ý«ö¤U¦P·NÁä
- Do
- Set E = .Document.getElementByid("Agree")
- Loop Until Not E Is Nothing
- E.Click
- End If
- Do
- Do
- Set E = .Document.getElementsByTagName("TABLE")(21 + i)
- '§Y®É²bÈ ²Ä21Ó "TABLE" ,'°ê¤º«ü¼Æ ²Ä22Ó "TABLE"
- Loop Until Not E Is Nothing
- 'Loop Until E.all.Length >= IIf(i = 0, 431, 150) '
- Loop Until InStr(1, E.outerHTML, IIf(i = 0, "00638R", "¹q¤lÃþ¥[ÅvªÑ»ù«ü¼Æ")) '§ï¥Î¬ÛÃö¦r¦ê½T»{¬O§_¦³¸ê®Æ
-
- '§R°£¡¶ ¡¿ ²Å¸¹¨Ã¥[¤W¼Æ¦rt¸¹Åã¥Ü
- If 0 = i Then
- For Each o In E.getElementsByClassName("ng-binding upcolor")
- If InStr(1, o.innerText, "¡¶ ¡¿") Then
- o.innerHTML = Mid(o.innerText, 5)
- End If
- Next
- For Each o In E.getElementsByClassName("ng-binding downcolor")
- If InStr(1, o.innerText, "¡¶ ¡¿") Then
- o.innerHTML = "-" & Mid(o.innerText, 5)
- Else
- o.innerHTML = "-" & o.innerText
- End If
- Next
- Else
- '±N«ü¼Æº¦¶^¤Îº¦¶^´T%¦r¦ê¤À¶}¨Ã¥[¤Wt¸¹Åã¥Ü
- For Each o In E.getElementsByClassName("ChangesText2 upcolor")
- k = InStr(1, o.innerText, "(")
- If 0 < k Then
- o.outerHTML = "<td>" & Mid(o.innerText, 1, k - 1) & "</td><td>" & Replace(Mid(o.innerText, k + 1), ")", "</td>")
- End If
- Next
- For Each o In E.getElementsByClassName("ChangesText2 downcolor")
- k = InStr(1, o.innerText, "(")
- If 0 < k Then
- o.outerHTML = "<td>-" & Mid(o.innerText, 1, k - 1) & "</td><td>-" & Replace(Mid(o.innerText, k + 1), ")", "</td>")
- End If
- Next
- End If
- .Document.body.innerHTML = Replace(E.outerHTML, "<span class=""ng-hide"" ng-show=""o.price == 0"">0</span>", "") ' ¥h°£ [§é·¸»ù] ¼Æ¦r«á±¦h¾lªº0
- '.Document.body.innerHTML = E.outerHTML
- 'Stop
- .ExecWB 17, 2 ' Select All
- .ExecWB 12, 2 ' Copy selection
- With ActiveSheet
- .Range("A" & IIf(i = 0, 1, 27)).Select
- .PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:=False, NoHTMLFormatting:=True
- With .Range(IIf(i = 0, "D16:D17", "C27:C28")).Interior
- .ColorIndex = 35
- .Pattern = xlSolid
- End With
- End With
- .Quit 'Ãö³¬ºô¶
- End With
- Next
- End Sub
½Æ»s¥N½X |
|