2017-06-04 67 views
-1

我從etf.com導入數據到我的Google表格。對於VTI ETF我想 拉動「YTD」元素。如何從本網站獲取xpath與xpath?

鉻檢查說我應該使用下面的

xpath=IMPORTXML("http://www.etf.com/VTI","//*[@id='form-reports-overview']/div[1]/div[5]/table/tbody/tr[2]/td[4]") 

這雖然沒有返回。

但是我可以提取大多數其他領域就好了。

回答

1

您可以嘗試兩種:

=index(IMPORTXML("http://www.etf.com/VTI","//td[@class='col4']"),1,1)*100&"%" 

或:

=index(importhtml("http://www.etf.com/VTI","table",5),2,4)*100&"%"