Google Sheets ImportXML – How to Import a JSON Query from Investing.com

google sheetsimportxml

I've trying this for several days and I'm not able to load the data displayed below the graph in https://es.investing.com/equities/facebook-inc

IMPORTHTML does not work because these fields are the response from a JSON query. I've used Chrome Dev Tools to save the result in a HAR file and found one of the fields "Retorno un año", but I am not able to automatize the query (curl cmd only returns the .js source code, not the response, it was the first time that I used it…):


Any ideas about how to import these fields into a Google Docs Spreadsheet?

P.S.: I can't paste the commands due to my low reputation (no more than 1 URL allowed), sorry 🙁

Best Answer

You can pull in all those fields using importxml instead of importhtml:

=IMPORTXML("https://es.investing.com/equities/facebook-inc","//*[@class='clear overviewDataTable']/*")

enter image description here