iframe ID正在更改每个标签。我怎么能固定它?

时间:2012-12-25 19:49:11

标签: html css imacros

任何具有imacros技能的人,我都对imacros脚本有问题..

当我做一些更改帧的脚本时,有时它F = 5,F = 6,F = 9,F = 12,否则..

当我跑步时,它会导致标签/错误。

你可以解决这个案子吗?

谢谢..

我正在做自动Facebook和Twitter分享代码。

这是我的imacros代码:

        URL GOTO=http://gnctrkcll.turkcell.com.tr/#!/haberler/ben-yaptim-paketyle-kend-paketn-kendn-yarat
        URL GOTO=http://gnctrkcll.turkcell.com.tr/#!/haberler/bu-yilbasi-kutlamalari-sudan-ucuz
        TAB T=1
        FRAME F=9
        TAG POS=1 TYPE=BUTTON ATTR=TXT:Like
        WAIT SECONDS=3
        TAG POS=2 TYPE=SPAN ATTR=TXT:Onayla
        TAB T=2
        FRAME F=0
        TAG POS=1 TYPE=INPUT:SUBMİT ATTR=TYPE:submit&&VALUE:Beğen

        WAIT SECONDS=4

        TAB T=1
        FRAME F=9
        TAG POS=1 TYPE=SPAN ATTR=TXT:Tweet
        TAB T=2
        FRAME F=9
        TAG POS=1 TYPE=INPUT:SUBMİT FORM=ID:update-form ATTR=CLASS:button<SP>selected<SP>submit&&TYPE:submit&&VALUE:Tweetle

3 个答案:

答案 0 :(得分:2)

您需要将代码转换为javascript格式并执行其他循环以搜索当前帧。像这样的东西:

var check =  "CODE:";
check+=  "FRAME F={{i}}" + "\n"; 
check+=  "TAG POS=1 TYPE=SPAN ATTR=TXT:Tweet" + "\n"; 
for(i=1;i<=15;i++){
iimSet("i",i);
iimPlay(check);}

答案 1 :(得分:2)

或者您可以对代码进行一些更改,并创建一个搜索帧数的函数,如此

///main code

var frame=SearchFrame();

//use frame to set into macro and play it





function SearchFrame()
{

var check =  "CODE:";
check+=  "FRAME F={{i}}" + "\n"; 
check+=  "TAG POS=1 TYPE=SPAN ATTR=TXT:Tweet CONTENT=EVEN:MOUSEOVER" + "\n"; 

frame=0;

for(i=1;i<=15;i++){
iimSet("i",i)

//if the result of the macro is true save frame number and break
if(iimPlay(check)==true)
{

frame=i;
break;
}
}
//return frame number
return frame;


}

答案 2 :(得分:1)

我在第一篇文章中使用了您的代码,并在Tweet按钮旁边放置了更改框架。

///////macro declaration////////////

var mainMacro;

mainMacro ="CODE:";

mainMacro +="URL GOTO=http://gnctrkcll.turkcell.com.tr/#!/haberler/ben-yaptim-paketyle-kend-paketn-kendn-yarat"+"\n";
mainMacro +="URL GOTO=http://gnctrkcll.turkcell.com.tr/#!/haberler/bu-yilbasi-kutlamalari-sudan-ucuz"+"\n";
mainMacro +="TAB T=1"+"\n";
mainMacro +="FRAME F=9"+"\n";
mainMacro +="TAG POS=1 TYPE=BUTTON ATTR=TXT:Like"+"\n";
mainMacro +="WAIT SECONDS=3"+"\n";
mainMacro +="TAG POS=2 TYPE=SPAN ATTR=TXT:Onayla"+"\n";
mainMacro +="TAB T=2"+"\n";
mainMacro +="FRAME F=0"+"\n";
mainMacro +="TAG POS=1 TYPE=INPUT:SUBMIT ATTR=TYPE:submit&&VALUE:Begen"+"\n";
mainMacro +="WAIT SECONDS=4"+"\n";

var mainMacro1="CODE:";
mainMacro1 +="TAB T=1"+"\n";
mainMacro1 +="FRAME F={{frame}}"+"\n";
mainMacro1 +="TAG POS=1 TYPE=SPAN ATTR=TXT:Tweet"+"\n";
mainMacro1 +="TAB T=2"+"\n";
mainMacro1 +="FRAME F=9"+"\n";
mainMacro1 +="TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:update-form ATTR=CLASS:button<SP>selected<SP>submit&&TYPE:submit&&VALUE:Tweetle"+"\n";


//////////Beginning/////////////

iimPlay(mainMacro)

//calling for the function which will find the frame
var frame=SearchFrame();

iimSet("frame",frame)
iimPlay(mainMacro1)




function SearchFrame()
{

var check =  "CODE:";
check+=  "FRAME F={{i}}" + "\n"; 
check+=  "TAG POS=1 TYPE=SPAN ATTR=TXT:Tweet CONTENT=EVEN:MOUSEOVER" + "\n"; 

frame=0;

for(i=1;i<=15;i++){
iimSet("i",i)

//if the result of the macro is true save frame number and break
if(iimPlay(check)==true)
{

frame=i;
break;
}
}
//return frame number
return frame;


}

我希望这有效。我不得不将你的宏分成2个宏。首先将导航到链接,然后第二个将点击Tweet按钮。如果它不起作用你自己做一点工作就可以了。