Solve Captcha

Verb: solveCaptcha

Available from: <Enterprise>

Solves a Captcha image entered as a variable, path or link.

Syntax

solveCaptcha --image(String) [--casesensitive(Boolean)] [--apikey(String)] [--languageType(Nullable<LanguageType>)] [--culture(String)] [--phraseType(Nullable<PhraseType>)] [--numericType(Nullable<NumericType>)] [--timeout(TimeSpan)] (String)=value (String)=error (Numeric)=confidence (Boolean)=success

Inputs

Script Designer Required AcceptedTypes Description
--image Image Required Text, Image Image source containing the Captcha.
1. An image type variable, a link or the path of the image file must be informed.
2. The image cannot be larger than 100 KB and cannot contain any text other than Captcha.
--casesensitive Case Sensitive Optional Boolean When enabled, it allows Captcha to differentiate upper and lower case letters.
--apikey API Key Optional Text Capctha API key used to communicate with the captcha API and resolve it. The key consists of a 32-character string, for example: 1abc234de56fab7c89012d34e56fa7b8 where it is obtained on the API site account settings page 2Captcha. The following types of captcha are supported:
  • Normal Captcha
  • ReCaptcha V2
  • ReCaptcha Callback
  • Invisible Recaptcha
  • ReCaptcha V3
  • ReCaptcha Enterprise
  • ReCaptcha V2 (old method)
  • Click Captcha
  • Rotate Captcha
  • Arkose Labs FunCaptcha
  • KeyCaptcha
  • GeeTest
  • hCaptcha
  • Capy Puzzle
  • TikTok
  • Currently, on the BR2 server, if the parameter is blank, the query is made using the 2Captcha key of IBM Robotic Process Automation.
    --languageType Alphabet Optional LanguageType Selects the type of alphabet used in Captcha:
  • Cyrillic Captcha
  • Latin Captcha
  • Not Specified
  • --culture Culture Optional Text, Culture Select which language the Captcha is in:
  • de-DE
  • en-US
  • es-ES
  • ko-KR
  • pt-BR
  • pt-PT
  • zh-CN
  • zh-TW
  • --phraseType Number of Words Optional PhraseType Select the number of words that the Captcha contains:
  • One Word
  • Two or more words
  • --numericType Type of Characters Optional NumericType Selects the type of characters that the captcha contains:
  • Letters
  • Not Specified
  • Numbers
  • Numbers and letters
  • Numbers or letters
  • --timeout Timeout Optional Time Span, Number, Text Maximum waiting time for the command to execute.
    In case no value is defined for the timeout parameter, the execution uses the context timeout defined by the Set Timeout command. If that command is not used on the script, the default timeout is 5 seconds.

    Outputs

    Script Designer AcceptedTypes Description
    value Text Text Captcha text that has been solved.
    error Error Text Percentage of error.
    confidence Confidence Number Captcha resolution reliability level.
    The returned value goes from 0 to 1, with "1" being the maximum reliability and "0" being the minimum.
    success Success Boolean Returns "True" if the Captcha is successfully resolved, or "False" if not.

    Example

    Example 1: Command resolves a Captcha image from the given link.

    defVar --name captchaText --type String
    defVar --name resolutionSuccess --type Boolean
    solveCaptcha --image "http://image.captchas.net/?client=demo" --languageType "NotSpecified" --phraseType "OneWord" --numericType "NotSpecified" captchaText=value resolutionSuccess=success
    logMessage --message "Found Text: ${captchaText}\r\nResolution Success: ${resolutionSuccess}" --type "Info"
    

    Example 2: Command solves a Captcha image from the selected path.

    defVar --name captchaText --type String
    defVar --name resolutionSuccess --type Boolean
    solveCaptcha --image "solveCaptcha.png" captchaText=value resolutionSuccess=success
    logMessage --message "Found Text: ${captchaText}\r\nResolution Success: ${resolutionSuccess}" --type "Info"
    

    Download File

    For the script to work as intended, dowload the image and add it to the same path specified at the Image parameter of the Solve Captcha command.

    See Also

  • Click by OCR
  • Get Control Text by OCR
  • Recognize Image Text or PDF