Warm tip: This article is reproduced from stackoverflow.com, please click
import xml xpath

ImportXML for live exchange rates from Xe.com

发布于 2020-04-08 09:21:47

I'm trying to import specific currency exchange rates,i.e. JPY-USD, JPY-EUR,JPY-INR etc from XE.com into Google spreadsheets using Import XML. How can I figure out the x path that I need from XE.com's page source? Help would be greatly appreciated!

URL: http://www.xe.com/currency/jpy-japanese-yen?r=

Questioner
SGK
Viewed
92
LuFFy 2017-03-29 14:47

Use IMPORTHTML instead :

=IMPORTHTML ("http://www.xe.com/currency/xau-gold-ounce","table",1) 

xe.com returns a table with the data which you could then use a HLOOKUP to only return the data for USD. Eg. :

=hlookup("USD",{IMPORThtML("http://www.xe.com/currency/xau-gold-ounce","table",1)},2,false)