HTML
In the below example, we are going to convert the HTML URL https://grafana.com/about/team/
into grafana datasource.
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.
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.
Example :
h4
--> h4 element will be selected.team__title
--> Element with the classteam__title
will be selectedtd: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 withcolspan
orrowspan
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.