How to figure out proper xpath for importxml in google sheets?

Viewed 104

I am trying to import and use XML data from http://wwwinfo.mfcr.cz/cgi-bin/ares/darv_std.cgi?ico=00064581

to Google Sheets with function IMPORTXML,

trying to get a subject name, id, and address (etc.), but I cannot figure out proper xpath to get it, receiving Imported content is empty. I can do //*, but this is not exactly what i need. Could you suggest me some hints please?

1 Answers

For example you can use something like this as formula of a cell:

=importxml("http://wwwinfo.mfcr.cz/cgi-bin/ares/darv_std.cgi?ico=00064581", "//*[name()='are:Shoda_ICO']")

In case you want to get multiple elements :

=importxml("http://wwwinfo.mfcr.cz/cgi-bin/ares/darv_std.cgi?ico=00064581", "//*[name()='dtt:Nazev_obce' or name()='are:Shoda_ICO']")
Related