Macro com 9kw Recaptcha Invisible Not Complete

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information:CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
wesleylex
Posts: 8
Joined: Mon Jan 25, 2016 7:59 pm
Location: Brazil

Macro com 9kw Recaptcha Invisible Not Complete

Post by wesleylex » Thu Jun 21, 2018 1:52 pm

I need help I created this macro it does the whole process
plus the invisible recaptcha is not completed

Code: Select all

VERSION BUILD=8920312 RECORDER=FX
SET !EXTRACT_TEST_POPUP NO
SET !ERRORIGNORE NO
SET !TIMEOUT_PAGE 999
SET !TIMEOUT_STEP 999
TAB CLOSEALLOTHERS
'
' This imacros script created by 9kw.eu
' Find more here: http://www.9kw.eu/
'
' The script fill the captcha of recaptcha v2 demo (interactive, invisible).
'
' Last update: 17 March 2018
'
' For iMacros 8.9.7
' See http://forum.imacros.net/viewtopic.php?t=26543
' http://wiki.imacros.net/iMacros_for_Firefox#How_to_Downgrade
'
' Note for users with firefox with the message "Firefox prevented this page from automatically reloading.":
' UNCHECK the option "warn me when pages try to redirect" in your browser
' You find the checkbox under Options > Advanced > General > Accessibility

' Step 1: Config for 9kw.eu for your apikey

SET apikey I removed my key not to be used

'And priority (prio 1-20)
SET prio 1

TAB T=1

URL GOTO=https://www.pontosmultiplus.com.br/cadastro/dados/?language=PT
CLEAR
URL GOTO=https://www.pontosmultiplus.com.br/cadastro/dados/?language=PT

TAG POS=1 TYPE=SELECT FORM=ID:step-1 ATTR=ID:select-residence-country CONTENT=%Brazil
WAIT SECONDS=1
EVENTS TYPE=KEYPRESS SELECTOR="#input-nascimento" CHARS="15071992"
WAIT SECONDS=1
TAG POS=1 TYPE=INPUT:TEL FORM=ID:step-1 ATTR=ID:cpf-document CONTENT=045.496.300-94


' Step 2: Save the captcha key and show the field for the answer
' Grab html code with sitekey
TAG POS=1 TYPE=DIV ATTR=ID:*recaptcha* EXTRACT=HTM
'TAG POS=1 TYPE=DIV ATTR=ID:*recaptcha* EXTRACT=HTM

' Grab the sitekey
SET !ERRORIGNORE YES
SET datasitekey1 EVAL("var sitekey = \"{{!EXTRACT}}\";var rx = new RegExp('sitekey=\"([^\"]+)\"','i'); var x = sitekey.match(rx)[1];  x;")
SET datasitekey2 EVAL("'{{!EXTRACT}}'.match(/anchor\?k=(.+?)&/)[1];")
SET datasitekey EVAL("if(\"{{datasitekey1}}\".length > 15){s = \"{{datasitekey1}}\"}else{s = \"{{datasitekey2}}\"};s;")
SET !ERRORIGNORE NO

' Or set your sitekey
'SET datasitekey 6LedZBgUAAAAAFqnBArRMxkDAXcW271V2DoHIHaG

'Syntaxcheck: API Key, prio
SET apikey EVAL("var s=\"{{apikey}}\"; if(s.match(/^[a-zA-Z0-9]+$/) && s.length <= 50 && s.length >= 5) s; else MacroError(\"API Key is wrong.\")")
SET prio EVAL("var s=\"{{prio}}\", d = parseFloat(s); if(d >= 0 && d <= 20) d; else MacroError(\"Value(Prio) is not in the set range.\")")
SET pageurl EVAL("domain = \"{{!URLCURRENT}}\".split(\"://\")[1];domain.split(\"/\")[0];")

'Step 3: Open the a new tab, and go to 9kw.eu, and submit the captcha picture
TAB OPEN
TAB T=2
URL GOTO=http://www.9kw.eu/grafik/form_base64.html
'The apikey is used to identify each of our customers, which you can get from the our page. It is assigned to the CONTENT.
TAG POS=1 TYPE=INPUT ATTR=NAME:apikey CONTENT={{apikey}}
'Priority in our system like min. 0 to max. 20 (cost +0-20)
TAG POS=1 TYPE=INPUT ATTR=NAME:prio CONTENT={{prio}}
'Options for the form. See more under http://www.9kw.eu/grafik/form_base64.html and http://www.9kw.eu/api.html
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ACTION:/index.cgi ATTR=NAME:selfsolve CONTENT=NO
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ACTION:/index.cgi ATTR=NAME:confirm CONTENT=NO
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ACTION:/index.cgi ATTR=NAME:base64 CONTENT=NO
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ACTION:/index.cgi ATTR=NAME:interactive CONTENT=YES
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ACTION:/index.cgi ATTR=NAME:case-sensitive CONTENT=NO
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ACTION:/index.cgi ATTR=NAME:nomd5 CONTENT=YES
TAG POS=1 TYPE=INPUT ATTR=NAME:maxtimeout CONTENT=3999
TAG POS=1 TYPE=INPUT ATTR=NAME:source CONTENT=imacros
TAG POS=1 TYPE=INPUT ATTR=NAME:oldsource CONTENT=recaptchav2
TAG POS=1 TYPE=INPUT ATTR=NAME:pageurl CONTENT={{pageurl}}
TAG POS=1 TYPE=INPUT ATTR=NAME:file-upload-01 CONTENT={{datasitekey}}
'Submit the formdata to 9kw.eu
TAG POS=1 TYPE=INPUT ATTR=TYPE:submit
'Extract the captchaid from your captcha submit
TAG POS=1 TYPE=INPUT ATTR=NAME:captchaid EXTRACT=TXT
SET captchaid {{!EXTRACT}}
'Clean the !EXTRACT variable for the next task
SET !EXTRACT NULL
'Extract the characters that are recoginzed from the picture of captcha.
TAG POS=1 TYPE=INPUT ATTR=NAME:result EXTRACT=TXT
'Step 4: Check the captcha answer (text or nothing like #EANF# = Extraction Anchor Not Found)
SET answer EVAL("if (\"{{!EXTRACT}}\" == \"#EANF#\") {var x = \"\";} else {var x = \"{{!EXTRACT}}\";} x;")
'Clean the !EXTRACT variable for the next task
SET !EXTRACT NULL
TAB CLOSE

'Display extracted data (only for debug)
'PROMPT {{captchaid}}

'Step 5: Fill the recognized characters to the verification box
TAB T=1
'js callback (function "onSuccess" in the htmlcode under "data-callback") with g-recaptcha-response field
URL GOTO=javascript:(function(){document.getElementById("g-recaptcha-response").innerHTML="{{answer}}";onSuccess();})();

'js callback with answer (function "recaptchaSolved" in the htmlcode under "data-callback")
'URL GOTO=javascript:(function(){recaptchaSolved("{{answer}}");})();

'With ba.l.callback (js callback without definition in the code)
'URL GOTO=javascript:(function(){___grecaptcha_cfg.clients[0].ba.l.callback("{{answer}}");})();

'Click the Verify button
WAIT SECONDS=1
TAG POS=1 TYPE=BUTTON FORM=ID:step-1 ATTR=ID:first-submit
it was to move on to step 2 plus the site does not do this
and asks to complete the recaptcha
thecoder2012
Posts: 248
Joined: Sat Aug 15, 2015 5:14 pm
Location: Internet
Contact:

Re: Macro com 9kw Recaptcha Invisible Not Complete

Post by thecoder2012 » Sat Sep 01, 2018 9:45 am

More details are helpful.

Your problem is this line in my test:

Code: Select all

EVENTS TYPE=KEYPRESS SELECTOR="#input-nascimento" CHARS="15071992"
In my tests was it only possible with Javascript (*.js):

Code: Select all

var utils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIDOMWindowUtils);
var input = window.document.getElementById('input-nascimento');
input.focus();
"15071992".split("").forEach(function(mychar) {
	['keydown','keypress','keyup'].forEach(function(type) {
		utils.sendKeyEvent(type, 0, mychar.charCodeAt(0), 0, 0);
	});
});
Tested with Pale Moon 27.6.2 and iMacros 8.9.7 because Waterfox 56 (or newer Firefox) was not possible in my tests. Our helpsite is helpful to grab the sitekey, maybe.

I hope you have enough knowledge because i'm busy a while and I have not enough time (without order) for a full example in Javascript and iMacros.
Join 9kw.eu Captcha Service now and let your iMacros continue downloads and scripts while you sleep. - Custom iMacros? Contact me!
Post Reply