Saving CAPTCHA image not working...sooo close

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.
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
jkwilson78
Posts: 3
Joined: Sat Jun 28, 2014 8:05 pm

Saving CAPTCHA image not working...sooo close

Post by jkwilson78 » Sat Jun 28, 2014 8:17 pm

Hello,

I am trying to save a captcha image and while it is saving an image it is saving the wrong part of the screen.

I am using:

version:
10022823

windows: 7

Tested in: imacros browser and imacros for IE


Here is my code:

Code: Select all

VERSION BUILD=10022823
CLEAR 
SET !DATASOURCE "C:\\account_data.csv"
PROXY ADDRESS={{!COL1}}
TAB T=1
ONDOWNLOAD FOLDER=C:\captcha FILE=captcha.jpg WAIT=YES
TAB CLOSEALLOTHERS
URL GOTO=https://accounts.google.com/ServiceLogin?service=adwords&hl=en-US&ltmpl=signup&passive=false&ifr=false&alwf=true&continue=https://adwords.google.com/um/SignupToken&app=Signup&sacu=1&sourceid=awo&subid=ww-ns-g-awhp_nelsontest3_nel_e
TAG POS=2 TYPE=INPUT:RADIO ATTR=NAME:keyGoogleAccount CONTENT=YES
FRAME NAME=newAccountLoginBox
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:createaccount ATTR=NAME:Email CONTENT={{!COL2}}
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=NAME:createaccount ATTR=NAME:Passwd CONTENT={{!COL3}}
TAG POS=1 TYPE=INPUT:PASSWORD FORM=NAME:createaccount ATTR=NAME:PasswdAgain CONTENT={{!COL3}}
TAG POS=1 TYPE=IMG FORM=NAME:createaccount ATTR=SRC:*https://accounts.google.com/Captcha?ctoken* CONTENT=EVENT:SAVE_element_screenshot
WAIT SECONDS=5
TAB OPEN
TAB T=2
SET !EXTRACT_TEST_POPUP NO
URL GOTO=http://api.deathbycaptcha.com/decaptcher?function=picture2&print_format=html
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:http://api.deathbycaptcha.com/decaptcher ATTR=NAME:username CONTENT=<my_user_name>
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:http://api.deathbycaptcha.com/decaptcher ATTR=NAME:password CONTENT=<my_password>
TAG POS=1 TYPE=INPUT:FILE FORM=ACTION:http://api.deathbycaptcha.com/decaptcher ATTR=NAME:pict CONTENT=C:\captcha\image.jpg
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:http://api.deathbycaptcha.com/decaptcher ATTR=VALUE:Send
WAIT SECONDS=30
TAG POS=6 TYPE=TD ATTR=* EXTRACT=TXT
SET !VAR1 {{!EXTRACT}}
TAB CLOSE
TAB T=1
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:createaccount ATTR=NAME:newaccountcaptcha CONTENT=!VAR1
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=NAME:createaccount ATTR=NAME:TermsOfService CONTENT=YES
Everything runs fine but when it processes line 15 in the Imacros browser instead of the captcha image being saved it just saves a portion of the top left of the screen. In the IE imacros browser it gives this error:
Error -1000: Cannot copy the item being saved to destination file: C:\captcha\captcha.jpg Unable to save screenshot of the current browser page. Notice that only HTML documents are currently supported (no PDF or office documents loaded via plugins). Line 15: TAG POS=1 TYPE=IMG FORM=NAME:createaccount ATTR=SRC:*https://accounts.google.com/Captcha?ctoken* CONTENT=EVENT:SAVEPICTUREAS
Which makes sense because there is no file type in the code of the page that specifies the type of file for the CAPTCHA image. Instead there is a randomly generated "key" that is used to reference the image.

I feel very close to getting this to work but something is either out of place/sequence or the references are wrong somehow.

I've spent 3 hours on this and it's driving me nuts :-) Any ideas?
jkwilson78
Posts: 3
Joined: Sat Jun 28, 2014 8:05 pm

Re: Saving CAPTCHA image not working...sooo close

Post by jkwilson78 » Sat Jun 28, 2014 9:21 pm

Well, I figured out the problem (new code below if it might help others) but now when the "sbmit" button is clicked I get a message saying the data cannot be displayed in an iframe (imacros and IE browsers)

In the firefox browser I get this error when clicking the submit button:
RuntimeError: Error loading page about:blank, line 33 (Error code: -933)

It works fine in firefox and IE if the imacros interface is not open but will not work otherwise.

Code: Select all

VERSION BUILD=10022823
CLEAR 
SET !DATASOURCE "C:\\account_data.csv"
PROXY ADDRESS={{!COL1}}
TAB T=1
TAB CLOSEALLOTHERS
URL GOTO=https://accounts.google.com/ServiceLogin?service=adwords&hl=en-US&ltmpl=signup&passive=false&ifr=false&alwf=true&continue=https://adwords.google.com/um/SignupToken&app=Signup&sacu=1&sourceid=awo&subid=ww-ns-g-awhp_nelsontest3_nel_e
TAG POS=2 TYPE=INPUT:RADIO ATTR=NAME:keyGoogleAccount CONTENT=YES
FRAME NAME=newAccountLoginBox
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:createaccount ATTR=NAME:Email CONTENT={{!COL2}}
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=NAME:createaccount ATTR=NAME:Passwd CONTENT={{!COL3}}
TAG POS=1 TYPE=INPUT:PASSWORD FORM=NAME:createaccount ATTR=NAME:PasswdAgain CONTENT={{!COL3}}
TAG POS=1 TYPE=IMG FORM=NAME:createaccount ATTR=SRC:https://accounts.google.com/Captcha?ctoken*
ONDOWNLOAD FOLDER=C:\captcha FILE=captcha.jpg
TAG POS=1 TYPE=IMG FORM=NAME:createaccount ATTR=HREF:https://accounts.google.com/Captcha?ctoken* CONTENT=EVENT:SAVEITEM
WAIT SECONDS=5
TAB OPEN
TAB T=2
SET !EXTRACT_TEST_POPUP NO
URL GOTO=http://api.deathbycaptcha.com/decaptcher?function=picture2&print_format=html
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:http://api.deathbycaptcha.com/decaptcher ATTR=NAME:username CONTENT=<username>
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:http://api.deathbycaptcha.com/decaptcher ATTR=NAME:password CONTENT=<password>
TAG POS=1 TYPE=INPUT:FILE FORM=ACTION:http://api.deathbycaptcha.com/decaptcher ATTR=NAME:pict CONTENT=C:\captcha\captcha.jpg
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:http://api.deathbycaptcha.com/decaptcher ATTR=VALUE:Send
TAG POS=6 TYPE=TD ATTR=* EXTRACT=TXT
SET !VAR1 {{!EXTRACT}}
TAB CLOSE
TAB T=1
FRAME NAME=newAccountLoginBox
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:createaccount ATTR=NAME:newaccountcaptcha CONTENT={{!EXTRACT}}
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=NAME:createaccount ATTR=NAME:TermsOfService CONTENT=YES
TAG POS=1 TYPE=INPUT:SUBMIT FORM=NAME:createaccount ATTR=NAME:submitbutton

Any ideas about the submit button issue?
lashsh
Posts: 9
Joined: Tue Aug 11, 2015 2:41 pm

Re: Saving CAPTCHA image not working...sooo close

Post by lashsh » Wed Aug 12, 2015 1:03 pm

I think you need 2captcha.com, it's a cheaper and best captcha automatization service.
It's also have a great support they will help you!
and also i found imacros: http://imacros2.rucaptcha.com/new/
Good luck.
User avatar
thecoder2012
Posts: 331
Joined: Sat Aug 15, 2015 5:14 pm
Location: Internet
Contact:

Re: Saving CAPTCHA image not working...sooo close

Post by thecoder2012 » Thu Oct 01, 2015 12:28 am

I think you use better SAVE_ELEMENT_SCREENSHOT and not SAVEPICTUREAS to save the captcha.
If you need a test example for your site, let me know it.
lashsh wrote:...best captcha automatization service.
Or other captcha services with full examples:
https://www.9kw.eu/grafik/plugins/9kweu.iim for recaptchaV1,
https://www.9kw.eu/grafik/plugins/9kweu ... cha_v2.zip for recaptchaV2,
https://www.9kw.eu/grafik/plugins/9kweu_confident.zip for confident or
https://www.9kw.eu/grafik/plugins/9kweu_media.iim for solvemedia
Join 9kw.eu Captcha Service now and let your iMacros continue downloads and scripts while you sleep. - Custom iMacros? Contact me! :idea:
chivracq
Posts: 8523
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Saving CAPTCHA image not working...sooo close

Post by chivracq » Fri Dec 01, 2017 6:01 am

lashsh wrote:I think you need 2captcha.com, it's a cheaper and best captcha automatization service.
It's also have a great support they will help you!
and also i found imacros: http://imacros2.rucaptcha.com/new/
Good luck.
thecoder2012 wrote:I think you use better SAVE_ELEMENT_SCREENSHOT and not SAVEPICTUREAS to save the captcha.
If you need a test example for your site, let me know it.
lashsh wrote:...best captcha automatization service.
Or other captcha services with full examples:
https://www.9kw.eu/grafik/plugins/9kweu.iim for recaptchaV1,
https://www.9kw.eu/grafik/plugins/9kweu ... cha_v2.zip for recaptchaV2,
https://www.9kw.eu/grafik/plugins/9kweu_confident.zip for confident or
https://www.9kw.eu/grafik/plugins/9kweu_media.iim for solvemedia
Both Posts secured for monitoring "Captcha War" on the Forum..., leading to "New Rules"... :wink:
- (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...
Gutt
Posts: 5
Joined: Thu Nov 16, 2017 6:41 pm

Re: Saving CAPTCHA image not working...sooo close

Post by Gutt » Fri Dec 01, 2017 7:34 pm

I did this for a project the other day.. this is what worked for me

Code: Select all

                M = M + "TAG POS=1 TYPE=IMG ATTR=SRC:https://www.google.com/recaptcha/api/image?c=* CONTENT=EVENT:SAVEPICTUREAS" + N
                M = M + "WAIT SECONDS=1" + N
                M = M + "TAB OPEN" + N
                M = M + "TAB T=2" + N
                M = M + "URL GOTO=http://api.deathbycaptcha.com/decaptcher?function=picture2&print_format=html" + N
                M = M + "TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:http://api.deathbycaptcha.com/decaptcher ATTR=NAME:username CONTENT=username" + N
                M = M + "TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:http://api.deathbycaptcha.com/decaptcher ATTR=NAME:password CONTENT=password<SP>endpartpassword" + N
                M = M + "TAG POS=1 TYPE=INPUT:FILE FORM=ACTION:http://api.deathbycaptcha.com/decaptcher ATTR=NAME:pict CONTENT=C:\Temp\image.jpg" + N
                M = M + "TAG POS=1 TYPE=INPUT:SUBMIT ATTR=TYPE:submit" + N
                M = M + "TAG POS=1 TYPE=TD ATTR=TXT:*<SP>* EXTRACT=TXT" + N
Post Reply