我应该如何抓取这个网页的https://www.bseindia.com/stock-share-price/asian-paints-ltd/asianpaint/500820/,并特别需要表中提到的净资产收益率数字?
我在Excel中使用了以下代码。我不太了解谷歌抓取床单
Sub FetchData()
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;https://www.bseindia.com/stock-share-price/asian-paints-ltd/asianpaint/500820/", Destination:=Range( _
"$A$1"))
.Name = "www"
.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
我无法正确获取数据。
对此有什么建议/帮助吗?需要ROE数字,其余部分不是必需的。
https://stackoverflow.com/questions/56415587
复制相似问题