【问题标题】:iMacro: test resulting URLiMacro:测试生成的 URL
【发布时间】:2016-05-25 12:57:29
【问题描述】:

使用 iMacro(chrome 扩展),我想在网站上自动执行操作:

  1. 选中一个复选框(条件)

  2. 点击按钮(提交)

  3. 然后将生成的 url 与字符串进行比较

    如果为真 ==> 从头开始​​重新启动脚本
    if false ==> 显示弹出消息(或任何其他提醒用户)

我在记录了第 1 步和第 2 步后从这里开始,它工作正常并且可以循环运行

VERSION BUILD=8350307 RECORDER=CR
URL GOTO=http://websitew.com/5421/0
REFRESH
TAG POS=1 TYPE=A ATTR=HREF:http://websitew.com/5421/0#
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:FormBookingCreate ATTR=ID:condition CONTENT=YES
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:FormBookingCreate ATTR=NAME:nextButton
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:FormBookingCreate ATTR=NAME:finishButton

此外,它不接受 if 声明,而且我不知道如何通过某种消息框或警报通知用户

SET current {{!URLCURRENT}}

#if current = "http://websitew.com/5421/0" then
MsgBox "OK!"
else
   """start from the beginning """

【问题讨论】:

    标签: automation imacros


    【解决方案1】:

    为 Chrome 'iMacros' 扩展尝试此解决方案:

    ' here your code with the 1st and 2nd steps '
    
    SET S EVAL("('{{!URLCURRENT}}' == 'http://websitew.com/5421/0') ? 'alert(\"OK!\");' : 'undefined';")
    URL GOTO=javascript:{{S}}
    
    ' uncomment the line below to stop your macro after a message box '
    'SET E EVAL("('{{S}}' == 'undefined') ? '' : MacroError('STOP!');")
    

    【讨论】:

    • 谢谢舒格。它完成了这项工作。现在我有了一个了解更多信息的良好开端。
    猜你喜欢
    • 2023-03-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-07-05
    相关资源
    最近更新 更多