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' })