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

Getting nothing - please help #3

Closed
triposat opened this issue Nov 2, 2023 · 1 comment
Closed

Getting nothing - please help #3

triposat opened this issue Nov 2, 2023 · 1 comment

Comments

@triposat
Copy link

triposat commented Nov 2, 2023

I'm trying to read the audio captcha but am unable to read it. It's showing me undefined.

const puppeteer = require('puppeteer');
const request = require('request');
const fs = require('fs');

(async () => {
  const browser = await puppeteer.launch({
    headless: true,
  });

  const audioFilePath = 'D:\\amazon_reviews\\audio.mp3';

  const audioBuffer = fs.readFileSync(audioFilePath);
  const base64Data = audioBuffer.toString('base64');

  request.post({
    url: 'http://2captcha.com/in.php',
    formData: {
      key: 'my_key',
      body: base64Data,
    }
  }, async (error, response, body) => {
    if (error) {
      console.error(error);
    } else {
      console.log(body)
      const captchaId = body.split('|')[1];
      request.get({
        url: `http://2captcha.com/res.php?key=my_key&action=get&id=${captchaId}`
      }, async (error, response, body) => {
        if (error) {
          console.error(error);
        } else {
          const captchaText = body.split('|')[1];
         
@kratzky
Copy link
Contributor

kratzky commented Nov 2, 2023

I think it's better for you to contact the support team.

@kratzky kratzky closed this as completed Nov 2, 2023
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

2 participants