I am trying to import single prices from different websites. For example, this price from this site https://www.fabricwholesaledirect.com/products/nylon-ripstop-dwr-fabric. I want to have an outputted price just from entering =getPrice and the URL.
So far this is what I've tried in Scripts editor: function
getPrice(url) {
var html = UrlFetchApp.fetch(url).getContentText();
html = html.substring(html.indexOf("bigPriceText1"));
html = html.substring(html.indexOf(">") + 1);
var txt = html.substring(0, html.indexOf("<"));
html = html.substring(html.indexOf("smallPriceText1"));
html = html.substring(html.indexOf(">") + 1);
return txt + html.substring(0, html.indexOf("<"));
};
I am not getting an error, but the output is blank. Any and all help is appreciated.