3

I'm trying to import the stock price to my google sheets, unfortunately Google Financials dosen't support stocks from the Oslo Exchange at the moment. I have been browsing online, but none of the code examples works.

E.g.

=IMPORTXML(ʺhttps://www.bloomberg.com/quote/GJF:NOʺ,ʺ//span[@class='priceText__1853e8a5']ʺ)

Should supposedly

Anyone who has an suggestion on how I can make this work?

tehhowch
  • 9,645
  • 4
  • 24
  • 42
xryxr
  • 79
  • 2
  • 2
  • 4
  • 1
    I still get errors when I'm changing the quotation marks. =IMPORTXML("https://www.bloomberg.com/quote/GJF:NO","//span[@class='priceText__1853e8a5']") – xryxr May 19 '18 at 00:18
  • 1
    Did you ever get this working? I am experiencing the same issue. – Dave New Sep 19 '20 at 08:10

2 Answers2

6

ImportHTML works for me. This returns the USD Spot Gold price

=Round(Index(ImportHTML("http://www.bloomberg.com/markets/commodities/futures/metals/","table",1),4,3),2)

and this GBP/EUR

=round(Index(ImportHTML("http://www.bloomberg.com/markets/currencies/cross-rates","table",1),3,5),5)

ImportHTML needs page source, table on page and row/col coordinates

Dharman
  • 30,962
  • 25
  • 85
  • 135
Peter
  • 71
  • 1
  • 4
  • If you're looking for the US silver spot, building on @Peter answer, this retrieves it: =Round(Index(ImportHTML("http://www.bloomberg.com/markets/commodities/futures/metals/","table",2),4,3),2) – delliottg Jun 17 '20 at 15:16
2

This works for me. Example here. Pretty sure your issue is quote types as mentioned above.

=IMPORTXML("https://www.bloomberg.com/quote/GJF:NO","//span[@class='priceText__1853e8a5']")
Tom Woodward
  • 1,653
  • 14
  • 21
  • do you mean between the two variables in the IMPORTXML function? comma is what documentation shows and it still works as far as I can tell https://support.google.com/docs/answer/3093342?hl=en – Tom Woodward Jul 27 '18 at 15:53
  • Deleted my comment, my spreadsheet uses semicolon because the comma is set to be the decimal separator. – Mefitico Jul 27 '18 at 17:01