Website interaction and solve captchas automatically

Automation of web page interaction, solve captchas automatically and sending notifications to cell phones

You may know this: you are waiting for information on a web page and you don’t want to constantly updating  the page manually? You always wanted to know, how to automate a web query and how you can solve captchas automatically? And you would rather prefer an automated process to monitor the website and send you a push notification to your cell phone when the information is available?

A smart solution could be using certain web services such as . How it works is exemplified here by using a sample page (

What can be seen in the video? The moving of the cursor, typing into the text boxes and solving the captcha is executed script controlled and not by the users themselves!

What can we learn?

  • How can we automate Windows and the interaction with a web page?
  • How can we solve the unpoplular captchas automatically?
  • How can we send a push notofication to the cell phone by using an automated process?

What do we need?

What is AutoIt?

AutoIt is a software that allows to simulate the interaction with a Windows PC. That means, a standard Windows PC is controlled by software and no real users. The language is very simple and based on the syntax that an average programmer already knows from the Java or .Net world. It even admits to create simple applications.

What is How to solve captchas automatically is a captcha solver service that accepts captchas as image files, solves them for a small fee and provides the characters as normal text via an interface. The result is obtained by a simple web request, which you can even call up the browser. The service collects the submitted captchas, list them on their platform to be solved. Other registered users call up the images and enter the solutions. The platform then places the result at the customers disposal. The subsequent status message contains the correct string that usually corresponds with the initial captcha.

As requestor you can determine various parameters that charcterise the complexity of the captcha. For instance, is the result expected to be case sensitive or does the captcha contain numbers, letters, special characters or even separate words etc.

Anyone can register on the Platform and solve captchas. If you feel like it, you may try a career as captcha solver – after all, you can earn $ 0.0001 per correct result … ..

The solving of 1000 captchas can cost up to 1 $ – by using Paypal it is just a matter of seconds to get started.


Install AutoIt  (standard installation procedure – Ok -> Ok -> Next .. etc.)

Unpack PycURL zip file and copy the contents from the folder site-package in the python folder to the local installation (eg C:\Python34\Lib\site-package)

It is important to know that I use a Windows7 PC with Google Chrome as a browser and a resolution of 1600 x 900 pixels in my example. You possibly have to adapt the pixel coordinates of your respective resolution and scaling in the script.

Here we go:

Open the AutoIt v3 SciTE Script Editor from the Start menu. You can start in the open document immediately. First, we create a new instance of Chrome along with the web page that you want to query. If you want to use another browser, you only need to specify the relevant path to the browser after the Run() command and adjust the window_title .

#include <Constants.au3>
#include <ScreenCapture.au3>
#include <Date.au3>
#include <Inet.au3>
#include <MsgBoxConstants.au3>
#include <Array.au3>
; Author: Heiko 

ClipPut("") ;  clear clip board initially 
Run("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe") ; Call Google Chrome - perhaps you have to change the path to browser executable 

$window_title = "Test-Page-Captcha - indiBit - Google Chrome" 

;get window handle 
$window_handle = WinWait($window_title) 
; maximize window 
WinSetState ( "Test-Page-Captcha - indiBit - Google Chrome", "",@SW_MAXIMIZE) ; window tile of process, which have to maximized

Now we let the cursor work for us a little bit. Click on the first text field to enter the name. After that, the script is pressing the Tab key to jump to the next text fields to fill in the values. In the last step the script saves the captcha image locally. Thus, we have automated the website query:

AutoItSetOption("MouseCoordMode", 0)
;wait one second
MouseClick("left", 300, 300, 1)
Send ("{TAB}")
Send ("{TAB}")
Send("your subject")
Send ("{TAB}")
Send("your message body")
MouseClick("right", 250,685, 1)
MouseClick("left", 260,505, 1)
;enter filename "captcha" 
;press Enter
;confirm with "y", if the PNG already exists ; y=yes

Now the captcha is converted into a PNG file on the desktop. This image now can be sent via Web API to the service On average, the solution of captchas is present after 10 seconds and can be pasted into the query window.

Captcha to solve: solve captchas automatically
Result from solve captchas automatically





To solve the captcha, send the picture via WEB request as a multipart document.

;we need a TCP connection for the webrequest
Local $file = "C:\Users\Heiko\Desktop\captcha.png"

$tcp = TCPConnect(TCPNameToIP(""), 80)
Local $boundary = "-----" & Random(10000000, 99999999, 1)

Local $data = "--" & $boundary & @CRLF
$data &= 'Content-Disposition: form-data; name="file"; filename="' & "captcha.PNG" & '"' & @CRLF & 'Content-Type: image/jpeg' & @CRLF & @CRLF

Local $data2 = @CRLF & "--" & $boundary & @CRLF & 'Content-Disposition: form-data; name="method"' & @CRLF & @CRLF & "post" & @CRLF
$data2 &= "--" & $boundary & "--" & @CRLF & @CRLF

Local $data3 = @CRLF & "--" & $boundary & @CRLF & 'Content-Disposition: form-data; name="key"' & @CRLF & @CRLF & "YourAPIKey" & @CRLF
$data3 &= "--" & $boundary & "--" & @CRLF & @CRLF

Local $header = 'POST /in.php HTTP/1.1' & @CRLF
$header &= 'Host:' & @CRLF
$header &= 'User-Agent: AutoIt/'&@AutoItVersion&' ('&@OSVersion&'; '&@OSServicePack&'; '&@OSArch&')' & @CRLF
$header &= 'Content-Type: multipart/form-data; boundary=' & $boundary & @CRLF
$header &= 'Content-Length: ' & (StringLen($data) + StringLen($data2) + StringLen($data3) + FileGetSize($file)) & @CRLF & @CRLF

TCPSend($tcp, $header)
TCPSend($tcp, $data)
TCPSend($tcp, FileRead(FileOpen($file)))
TCPSend($tcp, $data2)
TCPSend($tcp, $data3)

$r = ""
$i = 1
;write server response in a tooltip
While ($i<10)
$r &= TCPRecv($tcp, 1024)
ToolTip($r, 0, 0, "Debug")
$i = $i+1
if($i = 9) then

In the next step we take the CaptchaID we got as result for the uploaded picture and request the solution:

;Take the response from web request. In Line 10 you find the CaptchaID. You need this ID to request the captcha solution
 $r &= TCPRecv($tcp, 1024)
 $res = StringSplit($r,@CR) ; String split on every Carriage Return 
 ;_ArrayDisplay($res) ;Show content of string split
 ConsoleWrite("content: " & $res) ;show if you need
$captchaID = $res[10]
If (StringInStr($captchaID, "OK|") ) Then
 $captchaID = StringReplace($captchaID,"OK|","") ; remove "OK|"
 ;prepare information to request so solution
 $sPD = 'id=$captchaID'
 ;try 50 times if a solution is available.
 For $k = 50 to 1 Step -1
   $oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
   $oHTTP.Open("GET", "" & $captchaID, False)
   $oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
   ; send request
   ; In the result you can see that the captcha is not solved yet or an another error message or the hopefully correct solution.
   $oReceived = $oHTTP.ResponseText
   $oStatusCode = $oHTTP.Status
   $oReceivedResult = $oReceivedResult & $oReceived & @CRLF
   ToolTip($oReceivedResult, 0, 200, "Captcha Check")
   $oReceived = StringReplace($oReceived,"OK|","") ; remove "OK|"
   If ($oReceived= "CAPCHA_NOT_READY") Then
   If $oStatusCode <> 200 then
   MsgBox(4096, "Response code", $oStatusCode)

If the hopefully correct solution has been transferred, it can be written in the captcha result textbox.

MouseClick("left", 250,710, 1); click in the text entry box to enter the solution 




 MouseClick("left", 250,750, 1); click the ok button

The following function takes the screenshot and saves it in a Dropbox folder. The link to the image will be sent by e-mail afterwards, so you possibly can ceck directly on the phone, if the result meets the specifications.

$filename = @MON&@MDAY&@HOUR&@MIN&@SEC ; filename is timestamp

 _ScreenCapture_SetJPGQuality(70) ; set jpg quality to 70 - should be enough

 _ScreenCapture_Capture("C:\Users\Heiko\Dropbox\Public\kitasucher_" & $filename & ".jpg") ; save screenshot file in a folder

 Return ("" & $filename & ".jpg")

EndFunc ;==>Screen

In the next post i will show how you can send the screenshot via email.

Used Sources:



  1. Antworten Literate Aspects

    Hello, thank you for the AutoIt data you have shared.

    Please, what is the name of the audio music you have on:

    It is amazing, I have been trying to find this song title for a while, and I was very surprised to discover it on you video. It is one of my favorite songs.

  2. Antworten vajjump


    „C:\Documents and Settings\Administrator.VAJRA-A55772675\Desktop\fg.au3“ (122) : ==> „If“ statement has no matching „EndIf“ statement.:
    Func _ScreenCapture_SetJPGQuality(70)

  3. Antworten Marco Broglia


    I cant understand line 86=> „$r &amp;= TCPRecv($tcp, 1024)“
    I think is not an Autoit syntax.
    By the way, good job, congratulations.

    • Antworten Sebastian

      Hi Marco,
      sorry for late response. This was just a little „feature“ of WordPress that sometimes crashes copied code.
      I made some corrections and hope, that it’s working fine now.

Hinterlasse eine Antwort

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.

WordPress Cookie Hinweis von Real Cookie Banner