我在这个宏的第4行得到错误的TAG命令格式。奇怪的是,当我删除变量并将TAG行作为一个单独的宏运行时,它工作正常。我甚至删除了变量并放入在1代替它,但仍然显示相同的错误。任何人都可以请求帮助吗?我到处寻找答案。
const L = "\n";
var pc;
var bret;
pc = 1;
bret = 1;
while (pc < 16 && bret > 0) {
iimSet("VAR1",pc)
bret = iimPlayCode("TAG XPATH=/html/body/form/div[3]/div[7]/div[1]/div[2]/div[3]/div[{{!VAR1}}]/div/div/div[1]/div[2]/div[1]/a" + L +
"WAIT SECONDS=3" + L +
"TAG POS=1 TYPE=DIV ATTR=ID:NavLink EXTRACT=TXT" + L +
"TAG POS=1 TYPE=SPAN ATTR=ID:lblTitle EXTRACT:TXT" + L +
"TAG POS=1 TYPE=SPAN ATTR=ID:lblPrice EXTRACT:TXT" + L +
"SCREENSHOT TYPE=PAGE FOLDER=* FILE="+pc + L +
"SAVEAS TYPE=EXTRACT FOLDER=* FILE=wassup.csv" + L +
"BACK");
pc++;
}
答案 0 :(得分:0)
我自己想通了。这发生在iimPlayCode的第4行,EXTRACT:提到了TXT,而它应该是EXTRACT = TXT。
const L = "\n";
var pc;
var bret;
pc = 1;
bret = 1;
while (pc < 16 && bret > 0) {
iimSet("VAR1",pc);
bret = iimPlayCode("TAG XPATH=/html/body/form/div[3]/div[7]/div[1]/div[2]/div[3]/div[{{!VAR1}}]/div/div/div[1]/div[2]/div[1]/a" + L +
"WAIT SECONDS=3" + L +
"TAG POS=1 TYPE=DIV ATTR=ID:NavLink EXTRACT=TXT" + L +
"TAG POS=1 TYPE=SPAN ATTR=ID:lblTitle EXTRACT=TXT" + L +
"TAG POS=1 TYPE=SPAN ATTR=ID:lblPrice EXTRACT=TXT" + L +
"SCREENSHOT TYPE=PAGE FOLDER=* FILE="+pc + L +
"SAVEAS TYPE=EXTRACT FOLDER=* FILE=wassup.csv" + L +
"BACK");
pc++;
}