From f78a90ce3426a292b92125b9ad530a24ad328eb0 Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Wed, 20 Sep 2023 09:28:12 -0400 Subject: [PATCH] cleaning up --- scrape.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/scrape.js b/scrape.js index 13e1afb..8afd3dc 100644 --- a/scrape.js +++ b/scrape.js @@ -7,7 +7,6 @@ const delay = (ms) => { } const scrapeInstance = async (link, page) => { - console.log('scraping instance'); await link.click(); await page.waitForNavigation(); @@ -34,6 +33,7 @@ const scrapeInstance = async (link, page) => { console.log({ instanceID, graduationDate, totalStudents, dropped, outcomes90Numeric, outcomes90Percent }); + return page.goBack(); } (async () => { @@ -69,12 +69,9 @@ const scrapeInstance = async (link, page) => { const instanceLinks = await page.$$('tr td:nth-child(2) a'); - await scrapeInstance(instanceLinks[0], page); - //for(elem of elems){ - //const prop = await elem.getProperty('innerHTML'); - //const value = await prop.jsonValue(); - //console.log(value); - //} + for(instance of instanceLinks){ + await scrapeInstance(instance, page); + } console.log('done'); //await page.screenshot({ path: 'outcomes.png' })