如何从这个站点拉出带有xpath的YTD?

时间:2017-06-04 16:20:56

标签: html xml xpath web-scraping google-sheets

我正在将数据从etf.com导入我的Google表格。对于我想要的VTI ETF 拉“YTD”元素。

Chrome检查说我应该使用以下

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

这不会返回任何内容。

但是我可以很好地提取大部分其他字段。

1 个答案:

答案 0 :(得分: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&"%"