首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何在Excel/Google表格中对站点进行Web抓取?

如何在Excel/Google表格中对站点进行Web抓取?
EN

Stack Overflow用户
提问于 2019-06-02 21:42:10
回答 3查看 171关注 0票数 1

我应该如何抓取这个网页的https://www.bseindia.com/stock-share-price/asian-paints-ltd/asianpaint/500820/,并特别需要表中提到的净资产收益率数字?

我在Excel中使用了以下代码。我不太了解谷歌抓取床单

代码语言:javascript
复制
 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数字,其余部分不是必需的。

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56415587

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档