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
I have an iMacros code that copies content from one blog and posts the article image and article body content to my Facebook Wall post. Here is the working code:
VERSION BUILD=844 RECORDER=CR
SET !EXTRACT_TEST_POPUP NO
SET URL http://www.marketwatch.com/story/too-early-to-tell-if-trump-bump-seen-in-jobs-numbers-economists-say-2017-03-10
URL GOTO={{URL}}
WAIT SECONDS=2
TAG POS=1 TYPE=IMG ATTR=CLASS:article-image<SP>MG EXTRACT=HREF
SET IMG {{!EXTRACT}}
SET !EXTRACT NULL
TAG POS=1 TYPE=DIV ATTR=ID:article-body EXTRACT=TXT
SET BODY EVAL("var s=\"{{!EXTRACT}}\"; s=s.split('More from this Website')[0]; s;")
SET !EXTRACT NULL
URL GOTO=www.facebook.com
WAIT SECONDS=2
TAG POS=1 TYPE=DIV ATTR=CLASS:composerAudienceWrapper<SP>stat_elem<SP>_ej0
WAIT SECONDS=2
EVENTS TYPE=KEYPRESS SELECTOR="DIV[CLASS='_1mf _1mj']" CHARS="{{IMG}}"
WAIT SECONDS=5
EVENTS TYPE=KEYPRESS SELECTOR="DIV[CLASS='_1mf _1mj']" KEYS="[8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8]"
WAIT SECONDS=2
EVENTS TYPE=KEYPRESS SELECTOR="DIV[CLASS='_1mf _1mj']" CHARS="{{BODY}}"
TAG POS=1 TYPE=BUTTON FORM=ID:u_0_15 ATTR=TXT:Post
WAIT SECONDS=2
At this line: EVENTS TYPE=KEYPRESS SELECTOR="DIV[CLASS='_1mf _1mj']" CHARS="{{IMG}}" , when the code pastes the image URL into Facebook, it does the work halfway and it starts to mis-function - meaning it starts clicking some randone buttons on my facebook wall (while this line of code is still executing)...
Is there a solution to this issue?
If you want to paste a large piece of text, try to do this via clipboard, for example:
SET !EXTRACT_TEST_POPUP NO
SET URL http://www.marketwatch.com/story/too-early-to-tell-if-trump-bump-seen-in-jobs-numbers-economists-say-2017-03-10
URL GOTO={{URL}}
WAIT SECONDS=2
TAG POS=1 TYPE=IMG ATTR=CLASS:article-image<SP>MG EXTRACT=HREF
SET IMG {{!EXTRACT}}
SET !EXTRACT NULL
TAG POS=1 TYPE=DIV ATTR=ID:article-body EXTRACT=TXT
SET BODY EVAL("var s=\"{{!EXTRACT}}\"; s=s.split('More from this Website')[0]; s;")
SET !EXTRACT NULL
URL GOTO=www.facebook.com
WAIT SECONDS=2
SET !CLIPBOARD {{IMG}}
TAG POS=1 TYPE=LABEL ATTR=TXT:"Choose a file to upload"
TAG POS=R1 TYPE=DIV ATTR=ID:* EXTRACT=HTM
SET id EVAL("'{{!EXTRACT}}'.match(/id="(.*?)"/)[1];")
EVENT TYPE=CLICK SELECTOR="#{{id}}>DIV>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV" BUTTON=0
EVENT TYPE=KEYPRESS SELECTOR="#{{id}}>DIV>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV>DIV:nth-of-type(2)>DIV" CHAR="v" MODIFIERS="ctrl"
' ...