I am getting an error when I try to click each of the pages one by one in the following way:
I have tried using the .click function of puppeteer but it gives me the error: Error: Execution context was destroyed, most likely because of a navigation.
const aTags= await page.$$('#someId > a')
for (const aTag of aTags) {
await aTag.click();
//Do stuff
page.goto(url); //this goes back to the initial page with the list of URLs
}
Would like to click the links one by one and return to the previous page