Why can not download the captcha using the following code - imacros

I was just trying to donwload the captcha from one website everything with educational purposes. But when i use the ONDOWNLOAD command, the captcha image never is in the tmp FOLDER.
So what im doing WRONG. I tried using Disabling error notifications, but still never the image is downloaded into the folder.
URL GOTO=https://www.coinpayments.net/index.php?ref=fe31773be1c8558db56c7b9f3063ae08
TAG POS=1 TYPE=A ATTR=TXT:Sign<SP>Up
TAG POS=2 TYPE=DIV ATTR=TXT:Create<SP>New<SP>Account<SP>Please<SP>make<SP>it<SP>at<SP>le*
'SEARCH SOURCE=REGEXP:\\b[A-Z0-9._%+-]+#[A-Z0-9.-]+\\.[A-Z]{2,4}\\b EXTRACT=$1
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:register ATTR=NAME:username CONTENT=examplethenomtest
TAG POS=1 TYPE=INPUT:EMAIL FORM=ACTION:register ATTR=NAME:email1 CONTENT={{!EXTRACT}}
TAG POS=1 TYPE=INPUT:EMAIL FORM=ACTION:register ATTR=NAME:email2 CONTENT={{!EXTRACT}}
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=ACTION:register ATTR=NAME:pass1 CONTENT=k1k1k1k1
TAG POS=1 TYPE=INPUT:PASSWORD FORM=ACTION:register ATTR=NAME:pass2 CONTENT=k1k1k1k1
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ACTION:register ATTR=ID:checkbox CONTENT=YES
TAG POS=2 TYPE=INPUT:CHECKBOX FORM=ACTION:register ATTR=ID:checkbox CONTENT=YES
SET url https://www.coinpayments.net/index.php?ref=fe31773be1c8558db56c7b9f3063ae08
SET apikey apikey
SET path C:\tmp\
SET file freeditcoin.jpg
SET tw 5
TAB OPEN
'TAB T=1
PROXY ADDRESS=0.0.0.0:0
'TAB CLOSEALLOTHERS
SET !TIMEOUT_PAGE 10
'URL GOTO={{url}}
SET !ENCRYPTION NO
SET !VAR1 EVAL("var randomNumber=Math.floor(Math.random()*10 + 1); randomNumber;")
Wait Seconds={{!Var1}}
FILEDELETE NAME={{path}}{{file}}
ONDOWNLOAD FOLDER={{path}} FILE={{file}}
TAG POS=1 TYPE=IMG ATTR=ID:captcha
WAIT SECONDS=11
SET !VAR1 EVAL("var randomNumber=Math.floor(Math.random()*10 + 1); randomNumber;")
Wait Seconds={{!Var1}}
WAIT SECONDS=6
TAG POS=1 TYPE=DIV ATTR=ID:captcha CONTENT=EVENT:SAVE_ELEMENT_SCREENSHOT
WAIT SECONDS=6

I checked the code you gave here is the list of issues.
The line having ONDOWNLOAD should be immediately followed by download of the captcha, so it should be give as follows.
SET !VAR1 EVAL("var randomNumber=Math.floor(Math.random()*10 + 1); randomNumber;")
Wait Seconds={{!Var1}}
ONDOWNLOAD FOLDER={{path}} FILE={{file}}
TAG POS=1 TYPE=IMG ATTR=ID:captcha CONTENT=EVENT:SAVE_ELEMENT_SCREENSHOT
Also notice that in the above code, the last line you were giving the type attribute as IMG instead of DIV.
Regarding the variable path, please give some other folder other than the C Drive which may be the root of your computer, try giving some path like C:\Users\asdf\Desktop. Using such a path, I can see that the image is getting downloaded!
SET path D:\
Below is the complete code, please let me know if your issues is resolved completely!
URL GOTO=https://www.coinpayments.net/index.php?ref=fe31773be1c8558db56c7b9f3063ae08
TAG POS=1 TYPE=A ATTR=TXT:Sign<SP>Up
TAG POS=2 TYPE=DIV ATTR=TXT:Create<SP>New<SP>Account<SP>Please<SP>make<SP>it<SP>at<SP>le*
'SEARCH SOURCE=REGEXP:\\b[A-Z0-9._%+-]+#[A-Z0-9.-]+\\.[A-Z]{2,4}\\b EXTRACT=$1
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:register ATTR=NAME:username CONTENT=examplethenomtest
TAG POS=1 TYPE=INPUT:EMAIL FORM=ACTION:register ATTR=NAME:email1 CONTENT={{!EXTRACT}}
TAG POS=1 TYPE=INPUT:EMAIL FORM=ACTION:register ATTR=NAME:email2 CONTENT={{!EXTRACT}}
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=ACTION:register ATTR=NAME:pass1 CONTENT=k1k1k1k1
TAG POS=1 TYPE=INPUT:PASSWORD FORM=ACTION:register ATTR=NAME:pass2 CONTENT=k1k1k1k1
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ACTION:register ATTR=ID:checkbox CONTENT=YES
TAG POS=2 TYPE=INPUT:CHECKBOX FORM=ACTION:register ATTR=ID:checkbox CONTENT=YES
SET url https://www.coinpayments.net/index.php?ref=fe31773be1c8558db56c7b9f3063ae08
SET apikey apikey
SET path D:\
SET file freeditcoin.jpg
SET tw 5
TAB OPEN
'TAB T=1
PROXY ADDRESS=0.0.0.0:0
'TAB CLOSEALLOTHERS
SET !TIMEOUT_PAGE 10
'URL GOTO={{url}}
SET !ENCRYPTION NO
SET !VAR1 EVAL("var randomNumber=Math.floor(Math.random()*10 + 1); randomNumber;")
Wait Seconds={{!Var1}}
ONDOWNLOAD FOLDER={{path}} FILE={{file}}
TAG POS=1 TYPE=IMG ATTR=ID:captcha CONTENT=EVENT:SAVE_ELEMENT_SCREENSHOT

Related

Having trouble getting text input working on imacro

I'm trying to record a macro with text input, but whenever it gets up to entering the text, I get the following error:
RuntimeError: element INPUT specified by ID:ctrl699077237575BF0A8F14562A1C861DE76E16F42BA592707587115627BCDE1D8831F90660D4D3C18832F46AF95CFDBC99 was not found, line 6 (Error code: -921)
Here is the macro I am trying to get working. Please share your thoughts.
VERSION BUILD=8970419 RECORDER=FX
TAB T=1
URL GOTO=https://www.simplyenergy.com.au/pay-my-bill/
TAG POS=1 TYPE=SPAN ATTR=TXT:Credit<SP>Card
FRAME F=1
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:frmMain ATTR=ID:ctrl699077237575BF0A8F14562A1C861DE76E16F42BA592707587115627BCDE1D8831F90660D4D3C18832F46AF95CFDBC99 CONTENT=Test<SP>123
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:frmMain ATTR=ID:ctrl40430E5B2B6C22C79DAAC192280DCD94AB9086F07518E7F9EB6990B64A77B57EFAA5B281D3E99CBE0BA543CC8AD9C10A CONTENT=Test<SP>123
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:frmMain ATTR=ID:ctrl699077237575BF0A8F14562A1C861DE792B18ADFEC66456C7F128AB6AA513AE0C6B291CFA6EE3A4378214EA839681B77 CONTENT=Test<SP>123
Try in the following way:
VERSION BUILD=8970419 RECORDER=FX
TAB T=1
URL GOTO=https://www.simplyenergy.com.au/pay-my-bill/
TAG POS=1 TYPE=SPAN ATTR=TXT:Credit<SP>Card
FRAME F=1
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:frmMain ATTR=ID:ctrl* CONTENT=Test<SP>123
TAG POS=2 TYPE=INPUT:TEXT FORM=ID:frmMain ATTR=ID:ctrl* CONTENT=Test<SP>123
TAG POS=3 TYPE=INPUT:TEXT FORM=ID:frmMain ATTR=ID:ctrl* CONTENT=Test<SP>123

iMacros to extract google results

I'm trying to extract google search results using iMacros, it does extracts the URL but instead of saving it redirected to extracted URL.
VERSION BUILD=10022823
TAB T=1
TAB CLOSEALLOTHERS
URL GOTO=https://www.google.com/?gws_rd=ssl
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:f ATTR=NAME:q CONTENT=Jhony
TAG POS=1 TYPE=BUTTON:SUBMIT FORM=NAME:f ATTR=NAME:btnG
'text input activated
TAG POS=1 TYPE=A ATTR=ONMOUSEDOWN:return* EXTRACT=HREF
SAVEAS TYPE=EXTRACT FOLDER=* FILE=links.csv
PROMPT {{!EXTRACT}}
SET !EXTRACT NULL
can anyone suggest what I'm doing wrong?
Perhaps, this could help:
TAB T=1
TAB CLOSEALLOTHERS
URL GOTO=https://www.google.com/?gws_rd=ssl
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:f ATTR=NAME:q CONTENT=Jhony
TAG POS=1 TYPE=BUTTON:SUBMIT FORM=NAME:f ATTR=NAME:btnG
TAG POS=1 TYPE=H3 ATTR=CLASS:"r" EXTRACT=HTM
SET !EXTRACT EVAL("'{{!EXTRACT}}'.match(/a href=\"(.*)\" onmousedown=/)[1];")
SAVEAS TYPE=EXTRACT FOLDER=* FILE=links.csv

iMacro Cannot download image generated by PHP

I would like to download the barcode image generated by the Barcode Generator(http://www.barcode-generator.org/)
Barcode type:
Code 128
Test Barcode:
2012546435231
Size:
Smaller
I have recorded a imacro to do this. However, the function SAVEPICTUREAS does not work.
How to solve the problem?
VERSION BUILD=8871104 RECORDER=FX
TAB T=1
URL GOTO=http://www.barcode-generator.org/
TAG POS=5 TYPE=INPUT:RADIO FORM=NAME:NoFormName ATTR=NAME:barcode
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:NoFormName ATTR=ID:data CONTENT=2012546435231
TAG POS=1 TYPE=SELECT FORM=NAME:NoFormName ATTR=NAME:size CONTENT=%1
TAG POS=1 TYPE=INPUT:SUBMIT FORM=NAME:NoFormName ATTR=ID:fbut
ONDOWNLOAD FOLDER=* FILE=+_{{!NOW:yyyymmdd_hhnnss}} WAIT=YES
TAG POS=1 TYPE=IMG ATTR=SRC:http://www.barcode-generator.org/getfile.php?file=edc51a721012c83824e0c09d90d11189/2012546435231.png CONTENT=EVENT:SAVEPICTUREAS
As a variant, replace your last line of code with:
TAG POS=1 TYPE=IMG ATTR=ALT:resulting<SP>barcode CONTENT=EVENT:SAVE_ELEMENT_SCREENSHOT

How to Capture div/table where Webpage gets refreshed continuously(to get live data) Imacro code(933)

I am tring to capture a table using CONTENT=EVENT:SAVE_ELEMENT_SCREENSHOT. My webpage is continuously getting refreshed as it gives live records due to which m facing problem, as
Imacro waits for webpage to get loaded. Can anyone please help me I am very new to Imacro and coding.
My code looks like this:
VERSION BUILD=8850919 RECORDER=FX
TAB T=1
URL GOTO=about:home
URL GOTO=http://10.1.0.100/
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:txt_usr_name CONTENT=*****
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD ATTR=ID:txt_password CONTENT=*******
TAG POS=1 TYPE=INPUT:BUTTON FORM=ID:form0 ATTR=ID:btn_logon
FRAME NAME="bottomLeftFrame"
TAG POS=1 TYPE=SPAN ATTR=TXT:Maintenance
TAG POS=1 TYPE=SPAN ATTR=TXT:Statistics
TAG POS=1 TYPE=TABLE ATTR=ID:list_table&TXT: CONTENT=EVENT:SAVE_ELEMENT_SCREENSHOT
FRAME NAME="bottomLeftFrame"
ONDIALOG POS=1 BUTTON=OK CONTENT=
TAG POS=1 TYPE=SPAN ATTR=ID:t_menu_logout
I have tried this method in my other webpages it worked perfectly as expected.
Thanks in advance
Try to see if this works. You have to put the download folder location in order for it to work.
VERSION BUILD=8850919 RECORDER=FX
TAB T=1
URL GOTO=about:home
URL GOTO=http://10.1.0.100/
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:txt_usr_name CONTENT=*****
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD ATTR=ID:txt_password CONTENT=*******
TAG POS=1 TYPE=INPUT:BUTTON FORM=ID:form0 ATTR=ID:btn_logon
FRAME NAME="bottomLeftFrame"
TAG POS=1 TYPE=SPAN ATTR=TXT:Maintenance
TAG POS=1 TYPE=SPAN ATTR=TXT:Statistics
ONDOWNLOAD FOLDER=C:\ FILE=screenshot.png
TAG POS=1 TYPE=TABLE ATTR=ID:list_table&TXT: CONTENT=EVENT:SAVE_ELEMENT_SCREENSHOT
FRAME NAME="bottomLeftFrame"
ONDIALOG POS=1 BUTTON=OK CONTENT=
TAG POS=1 TYPE=SPAN ATTR=ID:t_menu_logout

Imacros script stopped working all of a sudden

I have written this code earlier. Previously it was working fine. But suddenly one day iMacros stopped working without I changed anything....
it stops at line 19
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:http://api.deathbycaptcha.com/decaptcher ATTR=VALUE:Send
Even when I set the IGNOREERROR YES
Please help
VERSION BUILD=8300326 RECORDER=FX
TAB T=1
SET !EXTRACT_TEST_POPUP NO
SET !ERRORIGNORE YES
SET !LOOP 1
URL GOTO=http://bootleggers.us/jail.php
ONDOWNLOAD FOLDER=/Users/dymphi/Desktop/ FILE=image.jpg WAIT=YES
TAG POS=1 TYPE=IMG ATTR=HREF:http://www.google.com/recaptcha/api/image* CONTENT=EVENT:SAVEITEM
TAB OPEN
TAB T=2
URL GOTO=api.deathbycaptcha.com/decaptcher?function=picture2&print_format=html
FRAME F=0
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:http://api.deathbycaptcha.com/decaptcher ATTR=NAME:username CONTENT=dbcname
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:http://api.deathbycaptcha.com/decaptcher ATTR=NAME:password CONTENT=dbcpassword
TAG POS=1 TYPE=INPUT:FILE FORM=ACTION:http://api.deathbycaptcha.com/decaptcher ATTR=NAME:pict CONTENT=/Users/dymphi/Desktop/image.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 F=0
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/jail.php ATTR=ID:recaptcha_response_field CONTENT={{!VAR1}}
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:/jail.php ATTR=VALUE:Continueplaying!
URL GOTO=http://bootleggers.us/jail.php
TAG POS=1 TYPE=A ATTR=TXT:Bustout!
filedelete name=/Users/dymphi/Desktop/image.jpg
WAIT SECONDS=110
I'm also using deathbycaptcha for solving captcha and my code works fine, you should set a timeout before submitting:
URL GOTO=http://api.deathbycaptcha.com/decaptcher?function=picture2&print_format=html
TAG POS=1 TYPE=INPUT ATTR=NAME:username CONTENT=username
TAG POS=1 TYPE=INPUT ATTR=NAME:password CONTENT=pass
TAG POS=1 TYPE=INPUT ATTR=NAME:pict CONTENT=/Users/dymphi/Desktop/image.jpg
SET !TIMEOUT_STEP 30
TAG POS=1 TYPE=INPUT ATTR=TYPE:submit
TAG POS=6 TYPE=TD ATTR=* EXTRACT=TXT
TAB CLOSE
TAB T=1
SET !VAR1 {{!EXTRACT}}
I tested it even when the image doesn't exist, my version of iMacros is 8.3.0. Hope it will work.