iMacros + 2Captcha reCAPTCHA solution

by JFR147
1 replies
Hello Hello!

Have a problem lads.
I have modificated this script:

Code:
VERSION BUILD=8920312 RECORDER=FX
SET !EXTRACT_TEST_POPUP NO
SET !ERRORIGNORE NO
SET !TIMEOUT_PAGE 999
SET !TIMEOUT_STEP 999
TAB CLOSEALLOTHERS

' Path to the captcha image with timestamp
' Tempfolder like C:\ or C:\TEMP\ under windows or like /tmp/ under linux
SET tempfolder C:\temp\

' Tempslash (Path with slashs as tempfolder) and with the htmlfile recaptcha_v2.html
SET tempslash C:\temp\

' Tempfile
SET tempfile captcha_{ { !NOW:yyyymmdd_hhnnss } }.jpg

' Step 1: Config for 9kw.eu for your apikey
SET apikey my_api
'And priority (prio 1-20)
SET prio 0

' Step 2: Save the captcha picture to local disk
TAB T=1
URL GOTO=https://www.google.com/recaptcha/api2/demo
'FRAME NAME=I0_*
FRAME F=1
EVENT TYPE=CLICK SELECTOR="#recaptcha-anchor>DIV:nth-of-type(5)" BUTTON=0
WAIT SECONDS=3
ONDOWNLOAD FOLDER={ { tempfolder } } FILE={ { tempfile } } WAIT=YES
'FRAME NAME=I1_*
FRAME F=2
TAG POS=1 TYPE=DIV ATTR=ID:rc-imageselect CONTENT=EVENT:SAVE_ELEMENT_SCREENSHOT
WAIT SECONDS=5

TAB OPEN
TAB T=2
URL GOTO=file:///{ { tempslash } }recaptcha_v2.html?file:///{ { tempslash } }{ { tempfile } }
WAIT SECONDS=5
FILEDELETE NAME={ { tempfolder } }{ { tempfile } }
TAG POS=1 TYPE=DIV ATTR=* CONTENT=EVENT:SAVE_ELEMENT_SCREENSHOT
TAB CLOSE

'Wait a random number (1 to 5) of seconds
SET randomnumber EVAL("Math.floor(Math.random()*5 + 1);")
WAIT SECONDS={ { randomnumber } }

'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.\")")

'Step 3: Open the a new tab, and go to 9kw.eu, and submit the captcha picture
TAB OPEN
TAB T=2
URL GOTO=https://2captcha.com/imacros.html

TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:http://rucaptcha.com/in.php ATTR=NAME:key CONTENT=my_API_KEY
TAG POS=1 TYPE=INPUT:FILE FORM=ACTION:http://rucaptcha.com/in.php ATTR=NAME:file CONTENT={ { tempfolder } }{ { tempfile } }

ONDIALOG POS=1 BUTTON=OK CONTENT=
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:http://rucaptcha.com/in.php ATTR=*


WAIT SECONDS=3
SET !TIMEOUT_STEP 300
TAG POS=1 TYPE=* ATTR=TXT:* EXTRACT=TXT
SET !TIMEOUT_STEP 0
WAIT SECONDS=1
TAB CLOSE

TAB T=1
TAG POS=1 TYPE=INPUT ATTR=ID:recaptcha_response_field CONTENT={ { !EXTRACT } }
WAIT SECONDS=5
'Press Roll Button
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=ID:free_play_form_button

'Cleanup: Delete the old captcha picture
FILEDELETE NAME={ { tempfolder } }{ { tempfile } }
to merge my 2captcha account with iMacros and everything works fine up to this point:
Code:
72-TAG POS=1 TYPE=INPUT ATTR=ID:recaptcha_response_field CONTENT={ { !EXTRACT } }
73-WAIT SECONDS=5
74-'Press Roll Button
75-TAG POS=1 TYPE=INPUT:SUBMIT ATTR=ID:free_play_form_button
76-
77-'Cleanup: Delete the old captcha picture
78-FILEDELETE NAME={ { tempfolder } }{ { tempfile } }
and I got an error:

Code:
RuntimeError: element INPUT specified by ID:recaptcha_response_field was not found, line 72 (Error code: -921)
recaptcha won't get solved any ideas how to write this last phase correctly :?:
#2captcha #imacros #recaptcha #solution
  • Profile picture of the author thecoder2012
    Code:
    RuntimeError: element INPUT specified by  ID:recaptcha_response_field was not found, line 72 (Error code:  -921)
    recaptcha won't get solved any ideas how to write this last phase correctly :?:
    Your new recaptcha (api2) has no recaptcha_response_field as field. Don't merge old text recaptcha with the newest (click) recaptcha thing. See the imacros script for recaptcha v2 (zip) and try it again.
    {{ DiscussionBoard.errors[10604303].message }}

Trending Topics