mardi 26 décembre 2017

How can i use if/else statement in iMacros? (Captcha Control)

I want to use if/else statement in iMacros for captcha control. I have tried many times before. I made Macro 1 and Macro 2 and add if/else statement but it did not work. This is code ;

VERSION BUILD=8970419 RECORDER=FX
TAB CLOSEALLOTHERS
SET !EXTRACT_TEST_POPUP NO
SET !ERRORIGNORE YES
SET !TIMEOUT_PAGE 25
TAB T=1
URL GOTO= [ MY URL ]
TAG POS=1 TYPE=A ATTR=TXT:Skip<SP>Ad
SET !TIMEOUT_PAGE 120
WAIT SECONDS=7
FILEDELETE NAME=C:\Users\Dtractus\Desktop\deneme\captcha.png
ONDOWNLOAD FOLDER=C:\Users\Dtractus\Desktop\deneme\ FILE=captcha.png
TAG POS=1 TYPE=DIV ATTR=ID:adcopy-puzzle-image-captchaShortlink CONTENT=EVENT:SAVE_ELEMENT_SCREENSHOT
TAB OPEN
TAB T=2
URL GOTO=http://ift.tt/2pyMaec
TAG POS=1 TYPE=INPUT:FILE FORM=ACTION:http://ift.tt/2DTwJ3p ATTR=NAME:captcha CONTENT=C:\Users\Dtractus\Desktop\deneme\captcha.png
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:http://ift.tt/2DTwJ3p ATTR=NAME:key CONTENT=[ MY KEY]
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:http://ift.tt/2DTwJ3p ATTR=NAME:secret CONTENT=[ MY SECRET ]
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:http://ift.tt/2DTwJ3p ATTR=*
SET !TIMEOUT_STEP 25
SET !EXTRACT NULL
TAG POS=1 TYPE=DECAPTCHA ATTR=* EXTRACT=TXT
TAB CLOSE
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:link-view ATTR=ID:adcopy_response-captchaShortlink CONTENT=
WAIT SECONDS=3
TAG POS=1 TYPE=BUTTON FORM=ID:link-view ATTR=ID:invisibleCaptchaShortlink

After this code, if captcha is wrong, it gives a warning like this;

"The CAPTCHA was incorrect. Try again"

I want to check this warning after this code. If the captcha is correct I want to continue the code below. If captcha is wrong again, I want you to repeat captcha solve again.

SET !TIMEOUT_STEP 25
TAG POS=1 TYPE=A ATTR=TXT:Get<SP>Link
SET !TIMEOUT_PAGE 120
FILEDELETE NAME=C:\Users\Dtractus\Desktop\deneme\captcha.png
ONDOWNLOAD FOLDER=C:\Users\Dtractus\Desktop\deneme\ FILE=captcha.png
TAG POS=1 TYPE=DIV ATTR=ID:adcopy-puzzle-image CONTENT=EVENT:SAVE_ELEMENT_SCREENSHOT
TAB OPEN
TAB T=2
URL GOTO=http://ift.tt/2pyMaec
TAG POS=1 TYPE=INPUT:FILE FORM=ACTION:http://ift.tt/2DTwJ3p ATTR=NAME:captcha CONTENT=C:\Users\Dtractus\Desktop\deneme\captcha.png
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:http://ift.tt/2DTwJ3p ATTR=NAME:key CONTENT=[ MY KEY ]
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:http://ift.tt/2DTwJ3p ATTR=NAME:secret CONTENT=[ MY SECRET]
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:http://ift.tt/2DTwJ3p ATTR=*
SET !TIMEOUT_STEP 25
SET !EXTRACT NULL
TAG POS=1 TYPE=DECAPTCHA ATTR=* EXTRACT=TXT
TAB CLOSE
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:NoFormName ATTR=ID:adcopy_response CONTENT=
TAG POS=1 TYPE=INPUT:SUBMIT FORM=NAME:NoFormName ATTR=*

Aucun commentaire:

Enregistrer un commentaire