Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

158
Visualizações
NodeJS pass captcha with tesseract.js

I'm having a problem solving the capcha on a site.

The system works like this, first I go to the site with the pupeter and fill in the necessary information, and I save the screenshot of that part with the pupeter to solve the captcha there.

Then I try to read it with the tesseract.js module, but the result I want does not appear here.

import puppeteer from "puppeteer";
import { createWorker } from "tesseract.js";
const worker = createWorker();

const start = async function () {
  let launchOptions = { headless: false, args: ["--start-maximized"] };

  const browser = await puppeteer.launch(launchOptions);
  const page = await browser.newPage();

  await page.setViewport({ width: 1366, height: 768 });
  await page.setUserAgent(
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36"
  );

  await page.goto(
    "https://webihlaltakip.kgm.gov.tr/WebIhlalSorgulama/Sayfalar/Sorgulama"
  );

  await page.type('input[title="Plaka"]', "AA" as string);

  const logo = (await page.$(
    "#pnlUpdate > table > tbody > tr:nth-child(2) > td:nth-child(1) > table > tbody > tr:nth-child(2) > td"
  )) as any; 
  await logo.screenshot({
    path: "captchaImage.png",
  });

  setTimeout(() => {
    (async () => {
      await worker.load();
      await worker.loadLanguage("eng");
      await worker.initialize("eng");
      const {
        data: { text },
      } = await worker.recognize("./captchaImage");
      console.log(text);
      await worker.terminate();
    })();
  }, 2000);
};

start();

For example, the code written in the captcha picture is 5000 then result is very different.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda