0
我想製作一個宏獲取器,它首先登錄到網站,然後獲取html表數據。我已經從網站獲取html表格數據,但沒有登錄頁面,但我只在Excel表格中獲得了第一頁數據。我需要獲取表格的所有頁面數據,但首先登錄到網頁。 這裏是從網站獲取html表格數據的代碼。如何使用宏登錄到網站並獲取整個數據html表
Sub Macro1()
'
' Macro1 Macro
'
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;https://datatables.net/examples/basic_init/alt_pagination.html" _
, Destination:=Range("$A$1"))
.Name = "alt_pagination.html"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSelectedTables
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
ActiveWindow.SmallScroll Down:=-36
End Sub