iMacros for loop POS = {{k}} k不存在整数值/存储问题

时间:2013-12-09 05:55:52

标签: java javascript firefox firefox-addon imacros

我在使用iMacros进行循环时遇到问题,POS =依赖于k递增19次&存储该数据。我在整个执行过程中持有k值时遇到问题,虽然我知道在完成iimPlay()之后var重新设置并正确存储它。如果有人能帮助我,我将不胜感激!

var NewLine = "\n";
var PlayMacro;
var StoreData;
var k = 55;
iimSet("k",k);


WebExtract = "Code: ";
WebExtract += "TAB T=1" + NewLine;
WebExtract += "FRAME NAME="+"ext-comp-1006" + NewLine;
for (h = 0; h < 25; h++){
WebExtract += "TAG POS={{k}} TYPE=DIV ATTR=ID:* EXTRACT=TXT" + NewLine;
k =k+19;
}

PlayMacro = iimPlay(WebExtract );
StoreData = iimGetLastExtract ();
alert (StoreData);

1 个答案:

答案 0 :(得分:2)

试试这个:

var NewLine = "\n";
var PlayMacro;
var StoreData;
var k = 55;
WebExtract = "Code: ";
WebExtract += "TAB T=1" + NewLine;
WebExtract += "FRAME NAME="+"ext-comp-1006" + NewLine;
WebExtract += "TAG POS={{k}} TYPE=DIV ATTR=ID:* EXTRACT=TXT" + NewLine;
for (h = 0; h < 25; h++){
k =k+19;
iimSet("k",k);
PlayMacro = iimPlay(WebExtract);
StoreData = iimGetLastExtract ();
alert (StoreData);
}