diff --git a/src/GameSource.ts b/src/GameSource.ts index b68baf1..93dec07 100644 --- a/src/GameSource.ts +++ b/src/GameSource.ts @@ -10,7 +10,10 @@ import moment from "moment"; // require export default class GameSource { async getGamesFromHaifa(): Promise { const sourceUrl = `http://mhaifafc.com/games?lang=en`; - const result = await axios.get(sourceUrl); + console.log('Trying to get games from Haifa...'); + try { + const result = await axios.get(sourceUrl); + const parsedResult = parse(result.data.toString()); const gameBoxs = parsedResult.querySelectorAll(".game-box"); @@ -62,6 +65,10 @@ export default class GameSource { // return []; return games; } + catch (error) { + console.error(error); + } + } private findTime(headerSplit: string[]) { let time = '';