Goal: The goal is to grab the shiller PE from this website and to put it in a google sheet that updates every 24 hours.
Website: https://www.gurufocus.com/sector_shiller_pe.php
The table on the website with "shiller pe" values that needs to be scraped
Live values needed to be put in this google sheet
Solutions Tried:
- =IMPORTXML("URL","XPATH")
Tried to use this function in the spreadsheet, but it is just unable to grab the website because the website is too slow
- Google Apps Script
Made this script to grab the HTML of the data and return the shiller value for the Energy sector:
function energyFinder() {
var url = "https://www.gurufocus.com/sector_shiller_pe.php";
const html = UrlFetchApp.fetch(url).getContentText();
var regex = new RegExp(/\/mq5xwwf">26<\/a><\/b><\/u><\/td><td class="text_center">([0-9][0-9].[0-9][0-9])<\/td>/);
var e = regex.exec(html);
return e
Logger.log(e)
}
But this just returns null. Any solution would help, thanks!
p.s. new to the website so I cannon embed pictures yet, so sorry for that

Logger.log(html)to ensure that the page is getting downloaded.