O
O
olezhenka2017-03-29 18:37:07
JavaScript
olezhenka, 2017-03-29 18:37:07

How to get image from website in nodejs?

https://api.vk.com/captcha.php?sid=618089329524&s=1 I am given a link to a captcha, how can I get an image from this link into the clipboard?
I got something like this:
4103811c2f1e48b8a6f7e536f569ae2e.PNG
data.captcha_img - link to captcha
but I don’t know how to do it further ((9

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav, 2017-03-29
@Div100

var http = require('http');
var fs = require('fs');

var file = fs.createWriteStream("captcha.jpg");
var request = http.get(data.captcha_img, function(response) {
  response.pipe(file);
});

Try something like this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question