I am trying to open a series of url in an array in a headless browser using puppeteer. It works fine when one url is used, but when a loop is used, puppeteer throws an exception.
$("a").each(async (index,element)=>{
if($(element).attr("target") == "_blank"){
//urls are valid
let url = "https:"+$(element).attr("href");
let page = await browserPage.goto(url).then((response)=>{
console.log(response.status())
},(error)=>{
console.log(error)
})
}
})
An ERR_ABORTED exception is thrown for each element of the array
Is this some kind of rate limiting problem? if so how can i work around it?