An example of using Kantu and AntiCaptcha extensions to submit a captcha form

Code examples of Kantu extension for sending a form after AntiCaptcha plugin solves a captcha no matter if it's a reCAPTCHA 2 or a regular image captcha.

Example of using together with an AntiCaptcha plugin

Solve reCAPTCHA 2 (or any other captcha) by using Kantu and AntiCaptcha extensions.

{ "Name": "Kantu and AntiCaptcha Recaptcha 2 solving example", "CreationDate": "2018-12-20", "Commands": [ { "Command": "open", "Target": "", "Value": "" }, { "Command": "type", "Target": "name=demo_text", "Value": "test 123" }, { "Command": "comment", "Target": "Most important part: wait 120 seconds until the AntiCaptcha extension completes its work", "Value": "" }, { "Command": "store", "Target": "120", "Value": "!timeout_wait" }, { "Command": "comment", "Target": "Wait for the element div.antigate_solver to get additional 'solved' class", "Value": "" }, { "Command": "verifyElementPresent", "Target": "css=div.antigate_solver.solved", "Value": "" }, { "Command": "comment", "Target": "Submit form", "Value": "" }, { "Command": "clickAndWait", "Target": "/html/body/main/article/div/form/input[2]", "Value": "" } ] }

Example of using without AntiCaptcha plugin installation

There is a time when you can't install an AntiCaptcha extension for a particular browser. In this case we made a code that allows you to get a Recaptcha 2 solving functionsl just by including an JS file. Just add these two instructions after a page loading and before filling form. You also need to replace YOUR-ANTI-CAPTCHA-API-KEY with your API key.

... { "Command": "open", "Target": "", "Value": "" }, { "Command": "storeEval", "Target": "(function(){var d=document.getElementById(\"anticaptcha-imacros-account-key\");d||(d=document.createElement(\"div\"),d.innerHTML=\"YOUR-ANTI-CAPTCHA-API-KEY\",\"none\",\"anticaptcha-imacros-account-key\",document.body.appendChild(d))})();", "Value": "" }, { "Command": "storeEval", "Target": "(function(){var s=document.createElement(\"script\");s.src=\"\"+Math.random();document.body.appendChild(s);})();", "Value": "" } ...