nht_cntt

Recaptcha Box - Autoit

Jul 23rd, 2018
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<IE.au3>
  2. #include<string.au3>
  3. #include <GUIConstantsEx.au3>
  4. #include <StaticConstants.au3>
  5. #include <WindowsConstants.au3>
  6. $url = 'https://www.google.com/recaptcha/api2/demo'
  7. $g_recaptcha_response = RecaptchaBox($url)
  8. ClipPut($g_recaptcha_response)
  9. MsgBox(0,'g_recaptcha_response',$g_recaptcha_response)
  10.  
  11. Func RecaptchaBox($url)
  12. Local $oIE = _IECreateEmbedded()
  13. $Form1 = GUICreate("ReCaptcha Box", 321, 473, 555, 160)
  14. $obj = GUICtrlCreateObj($oIE, 0, 0, 316, 468)
  15. _IENavigate($oIE, $url)
  16. $site_key = _StringBetween(_IEDocReadHTML($oIE),'data-sitekey="','"')[0]
  17. _IEDocWriteHTML($oIE,'<div class="g-recaptcha" data-sitekey="'&$site_key&'"></div><script src="https://www.google.com/recaptcha/api.js"></script>')
  18. GUISetState(@SW_SHOW)
  19. While 1
  20.     $g_recaptcha_response = _StringBetween(_StringBetween(_IEDocReadHTML($oIE),'<textarea name="g-recaptcha-response"','/textarea>')[0],'>','<')[0]
  21.     if Not $g_recaptcha_response = '' Then ExitLoop
  22. WEnd
  23. GUIDelete($Form1)
  24. Return $g_recaptcha_response
  25. EndFunc
Add Comment
Please, Sign In to add comment