Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

160
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda