0

I'm using Copy XPath from Chrome to create my queries. It works very well but not for this question.

Here is the site I scrape data from.

One query that works (number next to "Senaste NAV-kurs" in table 1)

=IMPORTXML("http://www.di.se/di-fonder/fonddetaljer/?InstrumentId="&1085603;"//*[@id='fund-summary-wrap']/div[1]/dl[2]/dd/text()" )

But when I copy XPath from table with title "AVKASTNING" i'm getting no data, pls help

=IMPORTXML("http://www.di.se/di-fonder/fonddetaljer/?InstrumentId="&1085603;"//*[@id='ctl00_FourColumnWidthContent_ThreeColumnsContent_MainAndSecondColumnContent_fundInfo_fundPerformance_tableFund']/tbody/tr[4]/td[2]/span" )
4

1 回答 1

0

如果你愿意尝试另一种方式,下面会得到“AVKASTNING”表。

=IMPORTHTML("http://www.di.se/di-fonder/fonddetaljer/?InstrumentId=1085603","table",7)

如果您想要表中的特定值,请使用索引。以下示例获取第二行第二列的值:

=index(IMPORTHTML("http://www.di.se/di-fonder/fonddetaljer/?InstrumentId=1085603","table",7),2,2)
于 2016-07-29T20:38:34.323 回答