I'm trying to create a Google Apps Script that pulls a specific value from this webpage https://www.luno.com/en/price/XRP. I'm attempting to read the HTML to find the value that I'm looking for which the price of XRP from my broker, denoted as "MYR". Here's the code I'm trying to use.
function getXRP(){
var html = UrlFetchApp.fetch('https://www.luno.com/en/price/XRP').getContentText();
var loc = html.indexOf("MYR");
return html.substring(loc, loc+8);
}
From what I understand, html.indexof("MYR") is returning a value of 0, hence the output I'm getting is the first 8 characters of the websites XML
<!DOCTY
For reference, I'm trying to capture the price as below and insert it into my Google Sheets document. Any help would be greatly appreciated, Thank you!