我制作了一个Excel Vba代码,使用Web查询从网站的不同页面下载表格,但现在我想更改它以执行以下操作:
我已经完成了第一步和第二步,但我不知道如何进行第三步。 如果要使用Web查询,它会显示没有按下按钮的网站。
这是新代码的一部分(没有第三阶段):
Sub DownloadDataAfterButtonClicked()
Dim html As HTMLDocument
Dim oIE As Object, p1 As Integer, p2 As Integer, p3 As Integer, page As String, q1 As String, q2 As String, q3 As String
Dim app As New Excel.Application, nb As Excel.Workbook
Set oIE = CreateObject("InternetExplorer.Application")
oIE.Visible = True
app.Visible = True
Set nb = app.Workbooks.Add
page = ("http://www.example.com")
oIE.Navigate (page)
Do While oIE.busy Or (oIE.ReadyState <> 4): DoEvents: Loop
Set html = oIE.Document
Set NodeList = oIE.Document.getElementbyId("switchLink")
NodeList.Click