Reputation: 21
I am trying to import a table from the following website
http://financials.morningstar.com/valuation/price-ratio.html?t=MOS®ion=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?
Upvotes: 2
Views: 6636
Reputation: 5529
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®ion=usa&culture=en-US&cur=&type=price-earnings","//tr")
Upvotes: 2