I’m trying to get the value of the current week from the ESPN NFL schedule (https://www.espn.com/nfl/schedule). Week 1 is in the center of the wrapper in the top half of the page. I’m using GAS since I’ve connected this to google sheets/google forms. I’ve been able to get the values in the tables (the schedule), but I can’t get this value from outside the tables.
I’ve found a regex expression that should find the value that I want. I tested it using regex101 here: https://regex101.com/r/xDJCXT/1
var url = 'https://www.espn.com/nfl/schedule';
var html2 = UrlFetchApp.fetch(url).getContentText();
var regex = /class=["']bcustom--week is-activeb.*?range["]>(.*?)<//gm;
var weekNum = html2.match(regex);
console.log(weekNum);
However, my code is outputting “null” in the console