The problem with using Chrome inspect tool and then the
xPath is that Chrome will show parsed HTML which might not be the same that the one that
IMPORTXML can see.
Usually, to retrieve the informations, you have to decode the json contained in the code source, i.e. script id=”boerse-frankfurt-state”, but here this script only contains the format and data are loaded by asynchonous method (ajax).
I’m trying to retrieve an information from this page , and 532 more pages like this. The info is the SYMBOL – in this case BBUS – and for doing this in batch in a google sheet, I’ve tried the IMPORTXML. Being a total newbie, after having read the documentation on the
command, and having searched for examples of queries elsewhere-the best I could come up with was:
- in the webpage, select the text I wanted to retrieve
- using the “inspect” command in chrome, visualize the corresponding portion of code that reads
obviously, nowhere close to the simple structure I found in the query examples I was able to browse
- click on the […] select Copy>Xpath or Copy>full Xpath”
- paste it on my spreadsheet as
=IMPORTXML(A2; "/html/body/app-root/app-wrapper/div/div/app-etp/div/div/app-widget-datasheet-header/div/div/div/div/div/div/span") being
A2 the cell that contains the webpage url.
What I get is
#N/A. I am prepared to the idea that it’s a matter of the way the html code is written, but being this my first time on stack overflow, I’m also prepared to get some massive help!