【发布时间】:2019-06-02 13:42:10
【问题描述】:
我应该如何抓取这个网页https://www.bseindia.com/stock-share-price/asian-paints-ltd/asianpaint/500820/并特别需要表中提到的ROE图?
我在 Excel 中使用了以下代码。我对 Google Sheets Scraping 了解不多
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,其余不需要。
【问题讨论】:
-
缺少两个主要标签
excel和vba。 -
这个问题太宽泛了,因为它显然是在询问在两个电子表格应用程序上的工作方式非常不同的功能。
标签: xpath web-scraping google-sheets google-sheets-formula google-sheets-importxml