Google Sheets ImportXML returns “Resource at URL not found” for yahoo finance (stocks with “.”)

  Kiến thức lập trình

I have been trying to make a google sheet portfolio with international stocks. I have managed with using the “googlefinance” formula, but it does not cover a lot of international (outside of US) stocks. So I have been trying to adapt it with the XPath and yahoo finance. Unfortunately I have again found that I have some limitations with the stocks.

Tested TICKERS (ORCL NVDA LUNR SHELL.AS SIE.DE NESN.SW MSFT TSLA NSRGY NESM.F AAPL.NE ENR.DE AAPL)

The formula I am using is: =index(IMPORTXML("https://finance.yahoo.com/quote/"&A11,"//*[@class='livePrice svelte-mgkamr']//span"),1).

The thing that I see is that when the link has “SMTH.SM” it does not work. Otherwise it does. BUT one thing is bugging me – SIE.DE is working just fine somehow.

Any ideas? I hope that I will be able to pull out info even for stocks with dot in their name.
I have tried to use the link as it is (for example https://finance.yahoo.com/quote/SHELL.AS) instead of the cell and it still doesn’t work.

New contributor

Darina Dimitrova is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

LEAVE A COMMENT