iMacros + 2Captcha do reCAPTCHA


(Perdition) #1

Siema,

Mam pewien problem.

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 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-anchorDIV: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}}

w celu połączenia mojego konta na 2captcha z iMacros i wszystko działa dobrze do tego momentu:

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}}

dostaje error:

RuntimeError: element INPUT specified by ID:recaptcha_response_field was not found, line 72 (Error code: -921)

ma ktoś pomysł jak poprawnie napisać ostatnią faze skryptu :?:

iMacros for Firefox 8.9.4, Firefox 43.0.2, WIN7 ULTiMATE