Содержание

RecognizeCaptchaCB

Gets the text of the specified captcha, recognized with service CaptchaBot.

Syntax

function RecognizeCaptchaCB(aImage: TCSElement; aKey: string;
  aCaptchaID: integer; aPhrase: integer = 0; aMinLen: integer = 0; aMaxLen: integer = 0;
  aNumeric: integer = 0; aRegSense: integer = 0; aCalc: integer = 0;
  aRussian: integer = 0): string; overload;
function RecognizeCaptchaCB(aImage: TCSImage; aKey: string; aCaptchaID: integer;
  aPhrase: integer=0; aMinLen: integer = 0; aMaxLen: integer = 0; aNumeric: integer = 0;
  aRegSense: integer = 0; aCalc: integer = 0; aRussian: integer = 0): string; overload;

Parameters

Returned value

Notes

Examples

  1. LoadURI('http://www.google.com/recaptcha/learnmore');
    //Get the captcha image
    var image:=GetElement('img',0,['src'],['google.com/recaptcha/']);
    var CaptchaID: integer;
    //Send the image to recognize with service CaptchaBot
    var captchatext:=RecognizeCaptchaCB(image,'MyCBKey',CaptchaID);
    //If the text is not empty, then enter the text to the input field
    if captchatext<>'' then
    begin
      var input:=GetElement('input',0,['name','id'],['recaptcha_response_field','recaptcha_response_field'],true);
      ClickElement(input);
      TypeIn(captchatext);
    end;
  2. LoadURI('http://www.google.com/recaptcha/learnmore');
    //Get the captcha image
    var image:=GetImage(0,['src'],['google.com/recaptcha/']);
    var CaptchaID: integer;
    //Send the image to recognize with service CaptchaBot
    var captchatext:=RecognizeCaptchaAG(image,'MyCBKey',CaptchaID);
    //If the text is not empty, then enter the text to the input field
    if captchatext<>'' then
    begin
      var input:=GetElement('input',0,['name','id'],['recaptcha_response_field','recaptcha_response_field'],true);
      ClickElement(input);
      TypeIn(captchatext);
    end;