user3398251
user3398251

Reputation: 33

importxml google spreadsheet - "xml content cannot be parsed" error in NEW Google Sheets

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

Answers (1)

user3616725
user3616725

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)

  • a green tick on the bottom of the screen
  • a green "sheet" icon on the tab / window title bar (favicon)
  • a "Add-ons" menu item on the main toolbar between "Tools" and "Help"

Old sheets have (when opened)

  • no tick
  • a 3-coloured "drive" triangle icon on the tab / window title bar (favicon)
  • no "Add-ons" menu item

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

Related Questions