- ©«¤l
- 13
- ¥DÃD
- 0
- ºëµØ
- 0
- ¿n¤À
- 63
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- office 365
- ¾\ŪÅv
- 20
- ©Ê§O
- ¤k
- µù¥U®É¶¡
- 2022-2-1
- ³Ì«áµn¿ý
- 2024-11-20
|
¦^´_ 1# t8899 - Option Explicit
- Sub Ex_©_¼¯ªÑ¥«ADR()
- Dim E As Object, i As Integer, R As Integer, C As Integer
- Dim SH As Worksheet, Span As Object, S As Variant
- Dim Rng As Range
- Set SH = Sheets(1)
- SH.Cells.Clear
- S = Split("ªÑ¦W/ªÑ¸¹,,ªÑ»ù,º¦¶^,º¦¶^´T(%),¶R¶i,½æ¥X,¶}½L,¬Q¦¬,³Ì°ª,³Ì§C,¦¨¥æ¶q (ªÑ),®É¶¡ (CST)", ",")
- SH.Range("A1").Resize(, UBound(S) + 1) = S
- With CreateObject("InternetExplorer.Application")
- .Visible = True
- .Navigate "https://tw.stock.yahoo.com/adr"
- Do While .Busy Or .ReadyState <> 4: DoEvents: Loop
- Set E = .Document.querySelector("ul[class='M(0) P(0) List(n)']").all.tags("LI")
- For i = 0 To E.Length - 1
- '***** ¤¸¯À( LI ) Ū¨ú¾ã¦C.innertext ²M°£ Chr(13) & Chr(10) ¦r¤¸ *******************
- ' S = Replace(E(i).innertext, Chr(13) & Chr(10), "*")
- ' Do
- ' S = Replace(S, "**", "*")
- ' Loop While InStr(S, "**")
- ' S = Split(Mid(S, 2), "*")
- ' With SH.Cells(i + 2, 1).Resize(, UBound(S) + 1)
- ' .Cells = S
- '.Value = .Value
- ' End With
- '***** ¤¸¯À( LI )¤Uªº¤¸¯À(Span) Ū¨ú¾ã¦C.innertext ²M°£ªÅ¥Õ¦r¤¸ *******************
- Set Span = E(i).all.tags("span")
- Set Rng = SH.Range("a" & i + 2)
- For C = 1 To Span.Length - 1
- If Span(C).innertext <> "" Then
- Rng = Span(C).innertext
- Set Rng = Rng.Offset(, 1)
- End If
- Next
- Next
- .Quit 'Ãö³¬ºô¶
- End With
- End Sub
½Æ»s¥N½X |
|