From a0ef2ac7770acd2a67b796ab93f24c3642adb105 Mon Sep 17 00:00:00 2001 From: Xevion Date: Fri, 11 Aug 2023 02:28:21 -0500 Subject: [PATCH] Basic non-typescript demo script, .gitignore logs --- .gitignore | 1 + index.ts | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) 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