Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doesn't work on receita.fazenda.gov.br #17

Open
LuizFelipeNeves opened this issue Jun 24, 2024 · 0 comments
Open

doesn't work on receita.fazenda.gov.br #17

LuizFelipeNeves opened this issue Jun 24, 2024 · 0 comments

Comments

@LuizFelipeNeves
Copy link

import puppeteer from "puppeteer";

import { solveCaptcha } from "nocaptchaai-puppeteer";

const API_KEY = "api_key";
const UID = "NO-NEED";

const main = async () => {
  const options = {
    headless: false,
    ignoreHTTPSErrors: true,
  };

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

  await page.goto("https://solucoes.receita.fazenda.gov.br/Servicos/cnpjreva/cnpjreva_Solicitacao.asp");
  await page.waitForNetworkIdle();

  await page.waitForSelector('#cnpj');
  await page.type('#cnpj', '02581711000122')

  await solveCaptcha(page, API_KEY, UID, "pro", true);
  console.log('solved')

  await page.click('.btn-primary')
  await new Promise(r => setTimeout(r, 5000));

  await page.screenshot({
    path: `cnpj-screenshot.jpg`,
    fullPage: true
  });
  await browser.close();
};

main();

cnpj-screenshot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant