Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

157
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!