https://tw.stock.yahoo.com/d/i/rank.php?t=up&e=tse
Sub test()
Set Ie = CreateObject("InternetExplorer.Application")
Ie.Visible = True
Ie.Navigate "https://tw.stock.yahoo.com/d/i/rank.php?t=up&e=tse"
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("sheet2")
.Range("a1:f30").ClearContents
For S = 2 To 2 '已找出網頁的table內容在 2 中
For I = 0 To Element(S).Rows.Length - 1
k = k + 1
For J = 0 To Element(S).Rows(I).Cells.Length - 1 '資料的欄位共6位
.Cells(k, J + 1) = Element(S).Rows(I).Cells(J).innerText
Next
Next
Next
End With
Set Element = Nothing