Answer the question
In order to leave comments, you need to log in
How to download pictures synchronously?
There is a site, from it it is necessary to download pictures. I did it in python, no problem. Everything is synchronous and sequential. The server is not overloaded with requests and does not block me.
Now I'm trying to learn Node.js And it all comes down to asynchrony. I have for example a list of 30 images.
for(var i = 0; i < arr.length; i++){
request(arr[i]).pipe(fs.createWriteStream(name))
}
Answer the question
In order to leave comments, you need to log in
You need to look for the npm module for synchronous requests to the server, for a grabber this is just right https://github.com/ForbesLindesay/sync-request
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question