mirror of
https://github.com/Xevion/schedule-extract.git
synced 2025-12-06 17:16:22 -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/
|
.idea/
|
||||||
node_modules
|
node_modules
|
||||||
.log*
|
.log*
|
||||||
|
*.log
|
||||||
12
index.ts
12
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