我想从此处的资产负债表信息中下载零件(即特定的行和列...单元格):
https://www.barchart.com/stocks/quotes/AAPL/balance-sheet/annual
使用Chrome的“ xPath”,我有:
/html/body/div[2]/div/div[2]/div[2]/div/div[2]/div/div/div/div[3]/div[2]/div/ng-transclude/table/tbody/tr[4]/td[3]
使用适用于Chrome的“ xPath帮助器”
/html/body/div[@id='bc-main-content-wrapper']/div[@class='inner-wrap']/div[@class='main-content-wrapper content js-main-content-wrapper ']/div[@class='row']/div[@class='large-12 columns']/div[@class='one-column-block']/div[@class='row']/div[@id='main-content-column']/div[@class='column-inner']/div[@class='bc-financial-report']/div[@class='bc-table-scrollable']/div[@class='bc-table-scrollable-inner']/ng-transclude/table[@class='ng-scope']/tbody/tr[4]/td[3]
但是我只能从网页返回部分路径的所有数据,即:
=IMPORTXML(A1,"/html/body/div[2]/div/div[2]/div[2]/div/div[2]/div/div/div/div[3]")
和:
=IMPORTXML(A1,"/html/body/div[@id='bc-main-content-wrapper']/div[@class='inner-wrap']/div[@class='main-content-wrapper content js-main-content-wrapper']/div[@class='row']/div[@class='large-12 columns']/div[@class='one-column-block']/div[@class='row']/div[@id='main-content-column']/div[@class='column-inner']/div[@class='bc-financial-report']")
最初,我认为它与“ ng-transclude”部分有关……但是,正如您所看到的,我什至没有到达那部分路径。
我希望有人可以指出正确的方向来解决这个问题。
答案 0 :(得分:0)
也许:
对于整行:=index(importhtml("https://www.barchart.com/stocks/quotes/AAPL/balance-sheet/annual","table"),7,)
(Inventories
的示例)。
对于整列:=index(importhtml("https://www.barchart.com/stocks/quotes/AAPL/balance-sheet/annual","table"),,3)
(09-2017
的示例)。
对于单元格:=index(importhtml("https://www.barchart.com/stocks/quotes/AAPL/balance-sheet/annual","table"),7,3)
(对于Inventories
,例如09-2017
)。