Answer the question
In order to leave comments, you need to log in
How to control asynchronous requests in puppeteer on node.js?
Node js more than 11 requests gives an error, because there is a limit of 11 by default.
I know how to remove the limit, the question is different, how to send requests of 10 pieces in order to first work out these 10 requests, and then, upon completion, proceed to the next ones.
My code is like this
let images = [1,2,3,4,5,6,7,8,9,10,11,12];
var t = 0;
while(images.length > t) {
function parsing(url){
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto(url);
await page.content();
await browser.close();
console.log("Готово");
})();
}
const url = 'https://www.google.com/';
parsing(url);
t++;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question