iMacros + 2Captcha reCAPTCHA solution

Discussions and Tech Support related to automating the iMacros Browser or Internet Explorer from any scripting and programming language, such as VBS (WSH), VBA, VB, Perl, Delphi, C# or C++.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

iMacros + 2Captcha reCAPTCHA solution

by JFR147 on Thu Dec 24, 2015 9:20 am

Hello Hello!

Have a problem lads.
I have modificated this script:

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

' 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: Select all
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: Select all
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 :?:
JFR147
 
Posts: 3
Joined: Thu Dec 24, 2015 9:05 am

Re: iMacros + 2Captcha reCAPTCHA solution

by chivracq on Thu Dec 24, 2015 3:18 pm

JFR147 wrote:Hello Hello!

Have a problem lads.
I have modificated this script:

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

' 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: Select all
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: Select all
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 :?:

(F)CIM...! :mrgreen: (And confirm v8.9.2 which is not the current latest Version...)

No need to spam the Forum by duplicating your Posts/Threads, I've deleted the other one... 8)
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6473
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: iMacros + 2Captcha reCAPTCHA solution

by JFR147 on Fri Dec 25, 2015 6:26 am

(F)CIM = iMacros for Firefox 8.9.4, Firefox 43.0.2, WIN7 ULTiMATE
JFR147
 
Posts: 3
Joined: Thu Dec 24, 2015 9:05 am

Re: iMacros + 2Captcha reCAPTCHA solution

by JFR147 on Wed Dec 30, 2015 11:59 am

I've managed to make this script working, however there is last problem left that I can't solve,
namely frame recognition. Website which I'm on has only 2 frames rotation:

Code: Select all
FRAME F=2
EVENT TYPE=CLICK SELECTOR="#recaptcha-anchor>DIV:nth-of-type(5)" BUTTON=0


or

Code: Select all
FRAME F=1
EVENT TYPE=CLICK SELECTOR="#recaptcha-anchor>DIV:nth-of-type(5)" BUTTON=0


anyone knows how to write script that recognizes which frame provided by google recaptcha is currently on ?
JFR147
 
Posts: 3
Joined: Thu Dec 24, 2015 9:05 am

Re: iMacros + 2Captcha reCAPTCHA solution

by chivracq on Wed Dec 30, 2015 4:38 pm

JFR147 wrote:I've managed to make this script working, however there is last problem left that I can't solve,
namely frame recognition. Website which I'm on has only 2 frames rotation:

Code: Select all
FRAME F=2
EVENT TYPE=CLICK SELECTOR="#recaptcha-anchor>DIV:nth-of-type(5)" BUTTON=0


or

Code: Select all
FRAME F=1
EVENT TYPE=CLICK SELECTOR="#recaptcha-anchor>DIV:nth-of-type(5)" BUTTON=0


anyone knows how to write script that recognizes which frame provided by google recaptcha is currently on ?

OK..., consider posting your working Script, I had had a quick look after your previous Reply but your Script was not for that Google Page with no INPUT Field so I didn't do any digging in it, and I don't do any Captcha myself, so I would have had to start from Zero...

For your Frame Pb, I would think, you just try F=1 and F=2, with '!ERRORIGNORE' and that should do the trick...

Otherwise you try to tag stg on F=1 and F=2 and the one that gives stg different from "#EANF#" gives you the right Number (using 'EVAL()') to reuse for "FRAME F={{Frame_Nb}}"...
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6473
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: iMacros + 2Captcha reCAPTCHA solution

by thecoder2012 on Thu Feb 18, 2016 10:53 pm

JFR147 wrote:Have a problem lads.
I have modificated this script:

Use the newest example from this script for imacros with javascript and support for dynamic frame number. Original source:
https://www.9kw.eu/grafik/plugins/9kweu ... cha_v2.zip

JFR147 wrote:recaptcha won't get solved :( any ideas how to write this last phase correctly :?:

Use any frame number check and find your (input) field.
Join 9kw.eu Captcha Service now and let your iMacros continue downloads and scripts while you sleep. - Custom iMacros? Contact me!
User avatar
thecoder2012
 
Posts: 109
Joined: Sat Aug 15, 2015 10:14 am
Location: Internet

Re: iMacros + 2Captcha reCAPTCHA solution

by Mauphillips on Fri May 20, 2016 6:02 am

Sorry I'm a lamemon and some of this I can understand .
However I don't understand how you get the Trams Name or Number, Eg:
Frame F=1 or Frame F=2 . :?:
Mauphillips
 
Posts: 1
Joined: Thu May 19, 2016 7:51 pm

Re: iMacros + 2Captcha reCAPTCHA solution

by thecoder2012 on Fri May 20, 2016 6:40 am

Mauphillips wrote:Sorry I'm a lamemon and some of this I can understand .
However I don't understand how you get the Trams Name or Number, Eg:
Frame F=1 or Frame F=2 . :?:

With loops.
Join 9kw.eu Captcha Service now and let your iMacros continue downloads and scripts while you sleep. - Custom iMacros? Contact me!
User avatar
thecoder2012
 
Posts: 109
Joined: Sat Aug 15, 2015 10:14 am
Location: Internet

Re: iMacros + 2Captcha reCAPTCHA solution

by techimac on Sat Jun 04, 2016 4:16 pm

anyone has code for frame name?
frame numbers require lot of code.
techimac
 
Posts: 189
Joined: Fri Feb 20, 2015 2:27 pm

Re: iMacros + 2Captcha reCAPTCHA solution

by techimac on Sat Jun 04, 2016 4:23 pm

SET n5 EVAL("var s=\"{{answer}}\"; if(s.match(/^[0-9]+$/) && s.length <= 9 && s.length >= 2) s.substr(4,1); else MacroError(\"Captcha answer is wrong.\")")


I want to match 0 - 16
it's matching 0-9 in above code
techimac
 
Posts: 189
Joined: Fri Feb 20, 2015 2:27 pm


Return to Scripting and Command Line Interface

Who is online

Users browsing this forum: No registered users and 4 guests

-->