diff --git a/.gitignore b/.gitignore index f970039..e183351 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .idea/ node_modules .log* +*.log \ No newline at end of file diff --git a/index.ts b/index.ts index 4f7e870..f4e9cf3 100644 --- a/index.ts +++ b/index.ts @@ -1 +1,13 @@ -import * as cheerio from "cheerio"; \ No newline at end of file +import * as cheerio from "cheerio"; +import * as fs from "fs"; + +const $ = cheerio.load(fs.readFileSync('list.html')); +const classes = $('#scheduleListView').children('.listViewWrapper').toArray(); + +const getClassName = (html) => { + console.log(html); + return html.find('list-view-course-title').text(); +} + +console.log(`${classes.length} classes identified.`); +console.log(`First class: ${getClassName(classes[0])}`); \ No newline at end of file