Dim E As Object, myItems As Object, myitem
With CreateObject("InternetExplorer.Application")
.Visible = True
.Navigate "http://www.yuantaetfs.com/#/RtNav/Index"
Application.Wait Now + #12:00:03 AM# '有錯在開啟
Set myItems = .Document.getElementsByTagName("button")
For Each myitem In myItems
'Application.Wait Now + #12:00:00 AM# '有錯在開啟
If myitem.Name = "Agree" Then
myitem.Click '按下送出查詢按鈕
End If
Next
Set E = .Document.getElementsByTagName("TABLE")(21)
.Document.body.innerHTML = E.outerHTML
.ExecWB 17, 2 ' Select All
.ExecWB 12, 2 ' Copy selection
With ActiveSheet
'.Cells.Clear
.[A1].Select
.PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:=False, NoHTMLFormatting:=True
End With
.Quit '關閉網頁
End With