简体   繁体   中英

How to loops imacros using with javascript using extract element

I'm working on a imacro script which re-post content from my website to social websites.

media_raw check if there is new content. raw is the number of new posts.

The issue is that the loop is not working with raw variable as condition. Its working fine if I set a number manually.

var media_raw;
media_raw ="CODE:";
media_raw +="SET !ERRORIGNORE YES "+"\n";
media_raw +="URL GOTO=http://www.website.com/share/index.php "+"\n";
media_raw +="TAG POS=1 TYPE=SPAN ATTR=CLASS:media_row EXTRACT=TXT     "+"\n";
media_raw +="SET !VAR1 {{!EXTRACT}} "+"\n";

iimPlay(media_raw)

var raw = iimGetLastExtract();

for(var i=0;i<raw;i++)
{
iimPlay("fb.iim")
iimPlay("twitter.iim")
}

尝试使用parseInt()函数:

var raw = parseInt(iimGetLastExtract());

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM