HTML


In the below example, we are going to convert the HTML URL https://grafana.com/about/team/ into grafana datasource.

image

Once you open the page in browser, right click and inspect the element (first element of the array you want to display). Then copy the selector as your root / rows element.

image

Then you can select, individual properties of the row as columns of the table as shown in the example image. You can select any element with in the row context.

image

image

Example :

  • h4 --> h4 element will be selected
  • .team__title --> Element with the class team__title will be selected
  • td:nth-child(4) --> 4th td element within the row context will be selected. This will be useful when you element doesn't have any id or duplicate class names.

Limitations#

  • Only symmetrical data can be scrapped. (Example: table elements with colspan or rowspan will break the scrapping)
  • Only text element is supported. Attribute scraping not available
  • To scrap the AJAX content, use JSON type in the Query
  • Websites may block you/your IP address, If the scrapping is at high frequency/refresh rate. Be sensible and responsible about setting your refresh limits
  • Caching is not implemented. So be aware of the rate limits.