mirror of
https://github.com/Xevion/schedule-extract.git
synced 2025-12-06 01:16:15 -06:00
Basic non-typescript demo script, .gitignore logs
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
.idea/
|
||||
node_modules
|
||||
.log*
|
||||
*.log
|
||||
14
index.ts
14
index.ts
@@ -1 +1,13 @@
|
||||
import * as cheerio from "cheerio";
|
||||
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])}`);
|
||||
Reference in New Issue
Block a user