Scrap data using Google Spreadsheets

Let's assume that you want to scrap data from Morningstar to insert it into a Google Spreadsheet.

A function to do it is IMPORTXML(URL; HTML_FIELD_TO_SCRAP).


IMPORTXML(""; "//td[@class='line text']")

This function scraps all the td elements with class line text. It returns the VL: 18,84 EUR.

Scraping elements

To see the name of another element, right click on it and open the Google Inspector Console. The name of the element is written in blue and the class is written in orange.

Hi, I'm Erik, an engineer from Barcelona. If you like the post or have any comments, say hi.