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

172
Visualizações
How to avoid hcaptcha showing images to solve captcha while using puppeteer for webscraping

I am trying to scrape a site. But, when i try to pass captcha by pressing on captcha checkmark, it gives me the images to solve the captcha. Sometimes it does that and other times it just passes and navigates me to the page after solving captcha.

Below is the code of how I am setting up my puppeteer instance and page.

  puppeteer.use(StealthPlugin());
  
  const chromeOptions = {
    headless: false,
    ignoreHTTPSErrors: true,
    slowMo: 30,
    args: ['--no-sandbox'],
  }

  const browser = await puppeteer.launch(chromeOptions);
  const page = await browser.newPage();
  await page.evaluateOnNewDocument(() => {
    delete navigator.__proto__.webdriver;
  });

  await page.setUserAgent(randomUseragent.getRandom());
  await page.setJavaScriptEnabled(true);
  //page.setDefaultNavigationTimeout(0);
  await page.goto(`pagetoscrape`, {
    waitUntil: "domcontentloaded",
 });

And below is how I am trynna solve captcha.

  await delay(6000);
  const iframes = await page.$('iframe');
  const frame = await iframes.contentFrame();
  const a = await frame.$('#checkbox');
  await a.click();
  await delay(5000);
  await page.screenshot({path: 'headless-test-result.png'});
  console.log("Solving captcha........");
  await page.waitForNavigation();
  await delay(7000);
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