mirror of
https://github.com/Xevion/schedule-extract.git
synced 2025-12-07 09:16:23 -06:00
13 lines
421 B
TypeScript
13 lines
421 B
TypeScript
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])}`); |