|
VBA小白,想通过VBA自动提取网页数据,通过宏录制了代码,但不知道怎么修改,求助大神
这句话 "URL;http://old.lezhuan.com/luck/winList.php?p=1&luckNO=431293", Destination _
:=Range("$A$1"))
我网址有15页数据,粘贴到一个页签中,然后间隔是57行
以下是宏代码(网站可能打不开,需要账号密码)
Sub Macro1()
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://old.lezhuan.com/luck/winList.php?p=1&luckNO=431293", Destination _
:=Range("$A$1"))
.Name = "winList.php?p=2&luckNO=431293"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub
|
|