Skip to content

captcha.getCaptcha Blank Response #17

Description

@marcos-nunes-dev

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions