Not finding an element on the page

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.
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
jestice
Posts: 1
Joined: Fri Oct 07, 2016 9:04 pm

Not finding an element on the page

Post by jestice » Fri Oct 07, 2016 9:13 pm

Not finding an element on the page freebitco.in

Code: Select all

var element = window.document.getElementById('videoPoster');
if(element){iimPlay(
`CODE:
SET !ERRORIGNORE YES
WAIT SECONDS=2
FRAME F=2
TAG POS=1 TYPE=DIV ATTR=ID:videoPoster
WAIT SECONDS=15
FRAME F=0
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:adcopy_response CONTENT=januvia
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=ID:free_play_form_button
WAIT SECONDS=10
`);} 
else {iimPlay(
`CODE:
SET !ERRORIGNORE YES 
FILEDELETE NAME=C:\\CAPCH\\BotCaptcha 
ONDOWNLOAD FOLDER=C:\\CAPCH\\BotCaptcha FILE=free2.jpg    
WAIT SECONDS=15
TAG POS=1 TYPE=DIV ATTR=ID:adcopy-puzzle-image CONTENT=EVENT:SAVE_ELEMENT_SCREENSHOT
WAIT SECONDS=5
TAB OPEN
TAB T=2
URL GOTO=http://imacros2.2captcha.com/
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:getcapcha.php ATTR=TYPE:text&&VALUE:&&NAME:key&&SIZE:64 CONTENT=*
TAG POS=1 TYPE=INPUT:FILE FORM=ACTION:getcapcha.php ATTR=NAME:file CONTENT=C:\\CAPCH\\BotCaptcha\\free2.jpg
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:getcapcha.php ATTR=TYPE:submit&&VALUE:recognize
WAIT SECONDS=15
SET !EXTRACT NULL
TAG POS=1 TYPE=* ATTR=TXT:* EXTRACT=TXT
WAIT SECONDS=1
TAB CLOSE
TAB T=1
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:adcopy_response CONTENT={{!EXTRACT}}
WAIT SECONDS=1
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=ID:free_play_form_button
WAIT SECONDS=10
`);}
Element 100% there on the page!
also I tried to do so:

Code: Select all

var macro;

macro ="CODE:";
macro +="TAG POS=1 TYPE=DIV ATTR=CLASS:videoPoster CONTENT=EVENT:MOUSEOVER ";

var ret=null;

ret=iimPlay(macro);

if(ret>0)
{iimPlay(
`CODE:
SET !ERRORIGNORE YES
WAIT SECONDS=2
FRAME F=2
TAG POS=1 TYPE=DIV ATTR=ID:videoPoster
WAIT SECONDS=15
FRAME F=0
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:adcopy_response CONTENT=januvia
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=ID:free_play_form_button
WAIT SECONDS=10
`);

}
else
{iimPlay(
`CODE:
SET !ERRORIGNORE YES 
FILEDELETE NAME=C:\\CAPCH\\BotCaptcha 
ONDOWNLOAD FOLDER=C:\\CAPCH\\BotCaptcha FILE=free2.jpg    
WAIT SECONDS=15
TAG POS=1 TYPE=DIV ATTR=ID:adcopy-puzzle-image CONTENT=EVENT:SAVE_ELEMENT_SCREENSHOT
WAIT SECONDS=5
TAB OPEN
TAB T=2
URL GOTO=http://imacros2.2captcha.com/
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:getcapcha.php ATTR=TYPE:text&&VALUE:&&NAME:key&&SIZE:64 CONTENT=*
TAG POS=1 TYPE=INPUT:FILE FORM=ACTION:getcapcha.php ATTR=NAME:file CONTENT=C:\\CAPCH\\BotCaptcha\\free2.jpg
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:getcapcha.php ATTR=TYPE:submit&&VALUE:recognize
WAIT SECONDS=15
SET !EXTRACT NULL
TAG POS=1 TYPE=* ATTR=TXT:* EXTRACT=TXT
WAIT SECONDS=1
TAB CLOSE
TAB T=1
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:adcopy_response CONTENT={{!EXTRACT}}
WAIT SECONDS=1
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=ID:free_play_form_button
WAIT SECONDS=10
`);
}
Post Reply