Im trying to use with http://www.detran.rj.gov.br/captcha/captcha.asp?montaCaptcha=1&x=1540240788840 this captcha. Everything looks good but the:
console.log(captcha.getCaptcha(pixMap));
is blank a blank response. Inside pixMap everything looks right.
There is something there Im doing wrong?
Full code:
`
const unirest = require('unirest');
const captcha = require('./CaptchaParser');
let captchaUri = await page.$eval(CAPTCHA, e => e.getAttribute('src'));
console.log('captcha uri', captchaUri);
var onRequest = function(response) {
if (response.error) {
console.log('VIT Academics connection failed');
} else {
let pixMap = captcha.getPixelMapFromBuffer(response.body); //Working Here
fs.writeFileSync('captcha.bmp', response.body);
console.log("Blank Here", captcha.getCaptcha(pixMap));
}
};
unirest
.get(captchaUri)
.encoding(null)
.set('Content-Type', 'image/bmp')
.end(onRequest);
`
CaptchaUri is the link above
Im trying to use with http://www.detran.rj.gov.br/captcha/captcha.asp?montaCaptcha=1&x=1540240788840 this captcha. Everything looks good but the:
console.log(captcha.getCaptcha(pixMap));is blank a blank response. Inside pixMap everything looks right.
There is something there Im doing wrong?
Full code:
`
const unirest = require('unirest');
const captcha = require('./CaptchaParser');
let captchaUri = await page.$eval(CAPTCHA, e => e.getAttribute('src'));
console.log('captcha uri', captchaUri);
`
CaptchaUri is the link above