1
votes

I am trying to import a table from the following website http://financials.morningstar.com/valuation/price-ratio.html?t=MOS&region=usa&culture=en-US using google spreadsheet function ImportXML, I have problems with the xpath I found this one for for the table I am looking for: //*[@id="valuation_history_table"].

and I am using this formula=importXML(A4,"//*[@id="valuation_history_table"]")

but I get the following error msg:

Error
Formula parse error.

Could you please help me?

1
Have a look at here. Does this provide help? - uL1

1 Answers

0
votes

Your getting a formula parse error because you used double quotes in your xpath - also you wouldnt be able to pull it in anyway - if you want a much lighter , less complicated endpoint use this url instead (all the parameters are basically the same) but you can use xpath //tr and get the whole table

 =IMPORTXML("http://financials.morningstar.com/valuate/valuation-history.action?&t=XNYS:MOS&region=usa&culture=en-US&cur=&type=price-earnings","//tr")

enter image description here