|
|
|
@ -50,9 +50,10 @@ const scrapeInstance = async (link, page) => {
|
|
|
|
const graduationHTML = await graduationElem.getProperty('innerHTML');
|
|
|
|
const graduationHTML = await graduationElem.getProperty('innerHTML');
|
|
|
|
const instanceHeaderText = await graduationHTML.jsonValue()
|
|
|
|
const instanceHeaderText = await graduationHTML.jsonValue()
|
|
|
|
const graduationDate = instanceHeaderText.split(' - ')[1].trim();
|
|
|
|
const graduationDate = instanceHeaderText.split(' - ')[1].trim();
|
|
|
|
|
|
|
|
const startDate = instanceHeaderText.split(' - ')[0].trim().split(':')[1].trim();
|
|
|
|
|
|
|
|
|
|
|
|
console.log({ instanceID, course, graduationDate, totalStudents, dropped, graduates, seeking, outcomes90Numeric, outcomes90Percent });
|
|
|
|
console.log({ instanceID, course, startDate, graduationDate, totalStudents, dropped, graduates, seeking, outcomes90Numeric, outcomes90Percent });
|
|
|
|
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})`);
|
|
|
|
const res = await client.query(`INSERT INTO instances (instance_id, course, start_date, graduation_date, total_students, dropped, graduates, seekers, ninety_day_outcomes) VALUES (${instanceID}, '${course}', '${startDate}', '${graduationDate}', ${totalStudents}, ${dropped}, ${graduates}, ${seeking}, ${outcomes90Numeric})`);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
await page.screenshot({ path: 'outcomes.png' })
|
|
|
|
await page.screenshot({ path: 'outcomes.png' })
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -76,7 +77,7 @@ const scrapeInstance = async (link, page) => {
|
|
|
|
await delay(500) //wtf
|
|
|
|
await delay(500) //wtf
|
|
|
|
|
|
|
|
|
|
|
|
await page.type('input[type="text"]', 'matt.huntington@generalassemb.ly');
|
|
|
|
await page.type('input[type="text"]', 'matt.huntington@generalassemb.ly');
|
|
|
|
await page.type('input[type="password"]', 'Hunt!ngt0n80!');
|
|
|
|
await page.type('input[type="password"]', 'Hunt!ngt0n!2');
|
|
|
|
await page.click('input[type="submit"]');
|
|
|
|
await page.click('input[type="submit"]');
|
|
|
|
|
|
|
|
|
|
|
|
console.log('entered okta creds');
|
|
|
|
console.log('entered okta creds');
|
|
|
|
|