Multi-Captcha Solver Adapter - v1.1.2
    Preparing search index...

    Class CaptchaDetector

    Utility class for automatically detecting the type of captcha present on a webpage.

    This class can analyze HTML content to identify common captcha implementations including Google reCAPTCHA v2/v3 and hCaptcha by looking for specific patterns, scripts, and DOM elements.

    const detector = new CaptchaDetector();

    // Detect captcha on a webpage
    const captchaType = await detector.detect('https://example.com/login');

    if (captchaType === CaptchaType.RECAPTCHA_V2) {
    console.log('Found reCAPTCHA v2');
    }
    Index

    Constructors

    Methods

    Constructors

    Methods

    • Internal

      Analyzes HTML content to detect captcha types. This method is exposed for testing purposes and direct HTML analysis.

      Parameters

      • html: string

        The HTML content to analyze

      Returns CaptchaType

      The detected CaptchaType or null if none found

    • Detects the type of captcha present on a given URL.

      This method fetches the HTML content from the specified URL and analyzes it to identify captcha implementations. It supports proxy usage and handles Single Page Applications (SPAs) by waiting for initial content to load.

      Parameters

      • url: string

        The URL to analyze for captcha presence

      • Optionalproxy: ProxyOptions

        Optional proxy configuration for the HTTP request

      Returns Promise<CaptchaType>

      Promise that resolves to the detected CaptchaType or null if none found

      When the URL is invalid or network request fails

      // Basic detection
      const captchaType = await detector.detect('https://example.com');

      // Detection with proxy
      const proxyOptions = {
      type: 'http' as const,
      uri: '127.0.0.1:8080',
      username: 'user',
      password: 'pass'
      };
      const captchaType = await detector.detect('https://example.com', proxyOptions);