当我在 Firefox 中执行这个 javascript .js 文件时,它给出了错误
SyntaxError: wrong format of SET command, line: 1 (Error code: -910)
alexa 上的这个 url 每页有 25 个结果,这样的页面有 20 个。我需要捕获所有 25 x 20 = 500 个结果并将它们保存到文件中。
var jsLF="\n";
var macro;
macro = "CODE:";
macro += "VERSION BUILD=9002379" + jsLF;
macro += "TAB T=1" + jsLF;
macro += "TAB CLOSEALLOTHERS" + jsLF;
macro += "URL GOTO=http://www.alexa.com/topsites/countries/ID" + jsLF;
macro += "TAG POS={{i}} TYPE=H2 ATTR=* EXTRACT=TXT" + jsLF;
var macro1;
macro1 = "CODE:";
macro1 += "VERSION BUILD=9002379" + jsLF;
macro1 += "TAB T=1" + jsLF;
macro1 += "TAB CLOSEALLOTHERS" + jsLF;
macro1 += "URL GOTO=http://www.alexa.com/topsites/countries;{{j}}/ID" + jsLF;
//loop all the pages for each page get data
for (var j=0;j<3;j++)
{
iimDisplay(j);
iimSet("j", j);
iimPlay(macro1);
//iimPlay("CODE:SET !EXTRACT {{j}}jsLF SAVEAS TYPE=EXTRACT FOLDER=C:\\ FILE=hiprsites.txt");
//loop the first page and get result
for(var i=0;i<3;i++)
{
iimDisplay(i);
iimSet("i", i);
iimPlay(macro);
iimSet("i",i);
iimPlay("CODE:SET !EXTRACT {{i}}jsLF SAVEAS TYPE=EXTRACT FOLDER=C:\\ FILE=hiprsites.txt");
}
有人能帮助我吗。