Перейти до змісту
View in the app

A better way to browse. Learn more.

Файна Україна

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Обійти Recaptcha V3 за допомогою NodeJS і Puppeteer

Рекомендовані відповіді

Опубліковано
  • Адміністратор

Те, про що ви дізнаєтеся

  • Як надіслати цю форму з верифікацією Recaptcha V3 за допомогою коду Javascript у середовищі NodeJS.

  • Як додати власну функцію grecaptcha.execute на сторінку.

  • Як отримати токен з Anti-Captcha API і використовувати його на сторінці.

Вихідний код

const puppeteer = require('puppeteer');
const ac = require("@antiadmin/anticaptchaofficial");

async function main() {

    //set API key
    ac.setAPIKey('API_KEY_HERE');

    //Specify softId to earn 10% commission with your app.
    //Get your softId here: https://anti-captcha.com/clients/tools/devcenter
    ac.setSoftId(0);

    //set optional custom parameter which Google made for their search page Recaptcha v2
    //ac.settings.recaptchaDataSValue = '"data-s" token from Google Search results "protection"'

    const token = await ac.solveRecaptchaV3('https://anti-captcha.com/demo/?page=recaptcha_v3_submit_03',
        '6LcBXcwZAAAAAC93rrscdoOawWRCm2MI5uFg2_Gt',
        0.9, //minimum score required: 0.3, 0.7 or 0.9
        'test')
    console.log('solved token:', token)

    // Launch a headless browser
    const browser = await puppeteer.launch({
        headless: false,
        devtools: true
    }); // set headless to false to see the browser in action

    // Open a new page
    const page = await browser.newPage();

    // Intercept network requests
    await page.setRequestInterception(true);

    page.on('request', interceptedRequest => {
        // Block specific URL
        if (interceptedRequest.url().includes('https://www.google.com/recaptcha/api.js')) {
        interceptedRequest.abort();
        console.log('Blocked:', interceptedRequest.url());
        } else {
        interceptedRequest.continue();
        }
    });

    // Navigate to the desired page
    await page.goto('https://anti-captcha.com/demo/?page=recaptcha_v3_submit_03', {
        waitUntil: "domcontentloaded"
    }); // Replace with the URL you want to navigate to


    await page.evaluate((token) => {
        // Replacement for grecaptcha
        window['grecaptcha'] = {
            execute: function(sitekey, parameters) {
                console.log(`called execute function with sitekey ${sitekey} and parameters`, parameters)

                return new Promise(resolve => resolve(token))

            },
            ready: function(callback) {
                callback();
            }
        }
    }, token)


    console.log('page loaded, filling inputs');

    // Fill input fields
    await page.type('#message', 'the message', {delay: 100})

    console.log('submitting form..')
    await page.click('#contentbox > div > div > div.tac.padding20px > button');

    await new Promise(resolve => setTimeout(resolve, 5000));

    // Extract all text content from the page
    const allTextContent = await page.evaluate(() => {
        // Get all text nodes
        const elements = document.querySelectorAll('*');
        const texts = [];

        // Iterate through all elements to extract text content
        elements.forEach(element => {
            const elementText = element.textContent.trim();
            if (elementText.length > 0) {
                texts.push(elementText);
            }
        });

        return texts.join('\n');
    });

    // Log or process the extracted text content
    console.log(allTextContent);

    if (allTextContent.includes('Recaptcha test passed')) {
        console.log('Recaptcha test passed!');
    } else {
        console.log('Recaptcha test failed.');
    }

    // Wait for some time (for demonstration purposes)
    await new Promise(resolve => setTimeout(resolve, 15000));

    // Close the browser
    await browser.close();
}

// Run the main function
(async() => {
    main();
})();

Github

Для публікації повідомлень створіть обліковий запис або авторизуйтесь

Акаунт

Навігація

Пошук

Пошук

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.