Reputation: 33
I was trying to get few details from a link on google spreadsheet.
Link: http://www.justdial.com/Gurgaon/Travel-Agents/ct-302
I want to extract all the four lines i.e. name, phone no, address and category of each block.
I ran the following query to extract the name but it was not working.
importxml(url, "//span[@class='jcn']/a")
Error = "imported xml content cannot be parsed"
Please help.
Upvotes: 2
Views: 10640
Reputation: 3655
EDIT: Please note, that as of 18/06/2015 this error no longer appears in New Sheets! Looks like google fixed it! ;)
ORIGINAL ANSWER:
This has proved to be an interesting one...
I cannot explain why - the odd bahaviours in google sheets have baffled me for a while...
I have tested this, and your IMPORTXML() formula returns en error, as described by you on google sheets using the "New Google Sheets", but not on sheets that have been created using the "old sheets"
How to tell if a sheet is "old" or "new":
New sheets have (when opened)
Old sheets have (when opened)
How do you create an Old-Sheet? - Click g.co/oldsheets (here is the original google help article)
Once you've done that, write your IMPORTXML() function exactly as you described
Upvotes: 3