https://tw.stock.yahoo.com/adr
Sub adr()
Set Ie = CreateObject("InternetExplorer.Application")
' Ie.Visible = True
Ie.Navigate "https://tw.stock.yahoo.com/adr"
Do While Ie.Busy Or Ie.ReadyState <> 4: DoEvents: Loop
Dim I As Integer, S As Integer, k As Integer, J As Integer
Dim Element
Set Element = Ie.document.getelementsbytagname("table")
With Sheets("sheet1")
For S = 0 To 5
For I = 0 To Element(S).Rows.Length - 1
k = k + 1
For J = 0 To Element(S).Rows(I).Cells.Length - 1
.Cells(k, J + 1) = Element(S).Rows(I).Cells(J).innerText
Next
Next
Next
End With
Set Element = Nothing
Ie.Quit
End Sub作者: lee88 時間: 2022-6-4 18:44