|
|
|
@ -30,6 +30,10 @@ const scrapeInstance = async (link, page) => {
|
|
|
|
const droppedHTML = await droppedElem.getProperty('innerHTML');
|
|
|
|
const droppedHTML = await droppedElem.getProperty('innerHTML');
|
|
|
|
const dropped = parseInt(await droppedHTML.jsonValue())
|
|
|
|
const dropped = parseInt(await droppedHTML.jsonValue())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const graduatesElem = await page.$('.graduates');
|
|
|
|
|
|
|
|
const graduatesHTML = await graduatesElem.getProperty('innerHTML');
|
|
|
|
|
|
|
|
const graduates = parseInt(await graduatesHTML.jsonValue())
|
|
|
|
|
|
|
|
|
|
|
|
const seekingElem = await page.$('.job-seeking');
|
|
|
|
const seekingElem = await page.$('.job-seeking');
|
|
|
|
const seekingHTML = await seekingElem.getProperty('innerHTML');
|
|
|
|
const seekingHTML = await seekingElem.getProperty('innerHTML');
|
|
|
|
const seeking = parseInt(await seekingHTML.jsonValue())
|
|
|
|
const seeking = parseInt(await seekingHTML.jsonValue())
|
|
|
|
@ -47,8 +51,8 @@ const scrapeInstance = async (link, page) => {
|
|
|
|
const instanceHeaderText = await graduationHTML.jsonValue()
|
|
|
|
const instanceHeaderText = await graduationHTML.jsonValue()
|
|
|
|
const graduationDate = instanceHeaderText.split(' - ')[1].trim();
|
|
|
|
const graduationDate = instanceHeaderText.split(' - ')[1].trim();
|
|
|
|
|
|
|
|
|
|
|
|
console.log({ instanceID, course, graduationDate, totalStudents, dropped, seeking, outcomes90Numeric, outcomes90Percent });
|
|
|
|
console.log({ instanceID, course, graduationDate, totalStudents, dropped, graduates, seeking, outcomes90Numeric, outcomes90Percent });
|
|
|
|
const res = await client.query(`INSERT INTO instances (instance_id, course, graduation_date, total_students, dropped, seekers, ninety_day_outcomes) VALUES (${instanceID}, '${course}', '${graduationDate}', ${totalStudents}, ${dropped}, ${seeking}, ${outcomes90Numeric})`);
|
|
|
|
const res = await client.query(`INSERT INTO instances (instance_id, course, graduation_date, total_students, dropped, graduates, seekers, ninety_day_outcomes) VALUES (${instanceID}, '${course}', '${graduationDate}', ${totalStudents}, ${dropped}, ${graduates}, ${seeking}, ${outcomes90Numeric})`);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|