title: Get ReCaptcha image on Autoit
body: <p>i'm trying to make a bot (in Autoit) that automatically register in a web page.
  I have a problem when try to get recaptcha image. I use the following code</p>
  
  <pre><code>$imgCaptchaId = _IEGetObjById($oForm,"recaptcha_challenge_image")
  
     $imgCaptcha = $imgCaptchaId.src
     Local $sFile
     GUICreate("Captcha Image",400,200)
     $sFile = _GetURLImage($imgCaptcha, @TempDir &amp; "\Captcha.jpg")
     GUICtrlCreatePic($sFile,0,0,300,100)
     GUISetState(@SW_SHOW)
     Sleep(3000)
  
  EndFunc
  
  
  
  Func _GetURLImage($sURL, $sDirectory = @ScriptDir)
      Local $hDownload, $sFile
      $sFile = StringRegExpReplace($sURL, "^.*/", "")
      If @error Then
          Return SetError(1, 0, $sFile)
      EndIf
      If StringRight($sDirectory, 1) &lt;&gt; "\" Then
          $sDirectory = $sDirectory &amp; "\"
      EndIf
      $sDirectory = $sDirectory &amp; $sFile
      If FileExists($sDirectory) Then
          Return $sDirectory
      EndIf
      $hDownload = InetGet($sURL, $sDirectory, 17, 1)
      While InetGetInfo($hDownload, 2) = 0
          If InetGetInfo($hDownload, 4) &lt;&gt; 0 Then
              InetClose($hDownload)
              Return SetError(1, 0, $sDirectory)
          EndIf
          Sleep(105)
      WEnd
      InetClose($hDownload)
      Return $sDirectory
  EndFunc   ;==&gt;_GetURLImage
  </code></pre>
  
  <p>and here is a part of web source</p>
  
  <pre><code>&lt;div class="col-sm-9"&gt;
                  &lt;script type="text/javascript"&gt;
  var RecaptchaOptions = {lang:'en'};
  &lt;/script&gt;
  &lt;script type="text/javascript" src="http://api.recaptcha.net/challenge?k=6Lef6gAAAAAAAPvrfh4xDy4hU4HwxNntiEtiMiNv"&gt;&lt;/script&gt;&lt;script type="text/javascript" src="http://www.google.com/recaptcha/api/js/recaptcha.js"&gt;&lt;/script&gt;&lt;div class=" recaptcha_nothad_incorrect_sol recaptcha_isnot_showing_audio" id="recaptcha_widget_div" style=""&gt;&lt;div id="recaptcha_area"&gt;&lt;table id="recaptcha_table" class="recaptchatable recaptcha_theme_red"&gt; &lt;tbody&gt;&lt;tr&gt; &lt;td colspan="6" class="recaptcha_r1_c1"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="recaptcha_r2_c1"&gt;&lt;/td&gt; &lt;td colspan="4" class="recaptcha_image_cell"&gt;&lt;center&gt;&lt;div style="width: 300px; height: 57px;" id="recaptcha_image"&gt;&lt;img id="recaptcha_challenge_image" alt="reCAPTCHA challenge image" src="http://www.google.com/recaptcha/api/image?c=03AHJ_Vuv4Mq74aHE4GEYjHM22aHn5iq3BQrKDotZtRap-Ob5LQ1n84PxmJLJdUzbtfw__CumJ7PMfuP6LYOkTIstU3cdw06Q0cLql9Mn-bZTrs4fckUOs3yq8HYidNXztsqq3AZbgF0a2SbKCNKpTkc7bhZxetwUvl2fdlIYbKeAVMoMuJleaB_anXWnPKtPwQqm-EzEX4f9o-b-TtE4JzI9TtkARnZ7f6qeP5klty4UQDAtQ3yw7lVrf_qnr4jFSz93TOMn3li2GVl8VTgiX75Stn8AljBRShg&amp;amp;th=,CPmw1sTBQJgvckO25-wfSWNrWzDwAAAAsKAAAAAn2ADbfVjn_jg9HiajEe1G7myZuX88pWoDQy2COTvhzKRPbGBLzAxtSMy2pxZVajAMmwJvZMYoltM0ZCEGJ9WbDOnRGmZ6TUIpx17CTXRv2chm82-LE__ZTd1dTA9838egbW1zl2KiQDpm99NHA63o18YRM9Ee_Z4fcFTL-iFel2cDKck89wh8VnlTYCjcLapzdD9Eq44xOeYlb3VlKgiZvQ3sQfbaSaC3wH-gG1ziidF4wbBzIMgkrclgUgYyI5HtO66J1ivYxGLOM-weUM9EJQDlpwdT8vEBKRoSxH-J" height="57" width="300"&gt;&lt;/div&gt;&lt;/center&gt;&lt;/td&gt; &lt;td class="recaptcha_r2_c2"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td rowspan="6" class="recaptcha_r3_c1"&gt;&lt;/td&gt; &lt;td colspan="4" class="recaptcha_r3_c2"&gt;&lt;/td&gt; &lt;td rowspan="6" class="recaptcha_r3_c3"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td rowspan="3" class="recaptcha_r4_c1" height="49"&gt; &lt;div class="recaptcha_input_area"&gt; &lt;span style="display: none;" id="recaptcha_challenge_field_holder"&gt;&lt;input name="recaptcha_challenge_field" id="recaptcha_challenge_field" value="03AHJ_Vuv4Mq74aHE4GEYjHM22aHn5iq3BQrKDotZtRap-Ob5LQ1n84PxmJLJdUzbtfw__CumJ7PMfuP6LYOkTIstU3cdw06Q0cLql9Mn-bZTrs4fckUOs3yq8HYidNXztsqq3AZbgF0a2SbKCNKpTkc7bhZxetwUvl2fdlIYbKeAVMoMuJleaB_anXWnPKtPwQqm-EzEX4f9o-b-TtE4JzI9TtkARnZ7f6qeP5klty4UQDAtQ3yw7lVrf_qnr4jFSz93TOMn3li2GVl8VTgiX75Stn8AljBRShg" type="hidden"&gt;&lt;/span&gt;&lt;input autocomplete="off" name="recaptcha_response_field" id="recaptcha_response_field" autocorrect="off" autocapitalize="off" placeholder="Type the text" type="text"&gt; &lt;span id="recaptcha_privacy" class="recaptcha_only_if_privacy"&gt;&lt;a target="_blank" href="http://www.google.com/intl/en/policies/"&gt;Privacy &amp;amp; Terms&lt;/a&gt;&lt;/span&gt; &lt;/div&gt; &lt;/td&gt; &lt;td rowspan="4" class="recaptcha_r4_c2"&gt;&lt;/td&gt; &lt;td&gt;&lt;a title="Get a new challenge" id="recaptcha_reload_btn"&gt;&lt;img alt="Get a new challenge" src="http://www.google.com/recaptcha/api/img/red/refresh.gif" id="recaptcha_reload" height="17" width="25"&gt;&lt;/a&gt;&lt;/td&gt; &lt;td rowspan="4" class="recaptcha_r4_c4"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;a title="Get an audio challenge" id="recaptcha_switch_audio_btn" class="recaptcha_only_if_image"&gt;&lt;img src="http://www.google.com/recaptcha/api/img/red/audio.gif" id="recaptcha_switch_audio" alt="Get an audio challenge" height="16" width="25"&gt;&lt;/a&gt;&lt;a title="Get a visual challenge" id="recaptcha_switch_img_btn" class="recaptcha_only_if_audio"&gt;&lt;img src="http://www.google.com/recaptcha/api/img/red/text.gif" id="recaptcha_switch_img" alt="Get a visual challenge" height="16" width="25"&gt;&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;a title="Help" id="recaptcha_whatsthis_btn"&gt;&lt;img alt="Help" src="http://www.google.com/recaptcha/api/img/red/help.gif" id="recaptcha_whatsthis" height="16" width="25"&gt;&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="recaptcha_r7_c1"&gt;&lt;/td&gt; &lt;td class="recaptcha_r8_c1"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt; &lt;/div&gt;&lt;/div&gt;
  
              &lt;/div&gt;
  </code></pre>
  
  <p>Can anyone can help me?</p>