简体   繁体   English

如何在没有 Javascript 的情况下使用 iMacro If Else 语句?

[英]HOW TO iMacro If Else Statement without Javascript?

I currently make a iMacro script that use EXTRACT to find the TAG我目前制作了一个使用 EXTRACT 来查找 TAG 的 iMacro 脚本

VERSION BUILD=9030808 RECORDER=FX
SET !ERRORIGNORE YES
TAB T=1
TAG POS=1 TYPE=I ATTR=CLASS:icon-pencil&&TXT: EXTRACT=HTM

SET !VAR10 EVAL("var s='{{!EXTRACT}}'; if(s=='<i class=\"icon-pencil\" style=\"outline: 1px solid blue;\"></i>'){s='imacros://run/?m=ADD.iim';} else {s='imacros://run/?m=A.iim';}; s;")
URL GOTO={{!VAR10}}

How can I make the if statement ?我怎样才能做出 if 语句?

iMacros does not have if statements in it, from their FAQ: iMacros 中没有 if 语句,来自他们的常见问题解答:

The iMacros language itself is designed as a descriptive language (similar to HTML) and does not contain conditional statements. iMacros 语言本身被设计为一种描述性语言(类似于 HTML)并且不包含条件语句。 We did not add such statements as we do not think that our customers should have to attend week-long seminars just to learn yet another proprietary scripting or programming language.我们没有添加这样的声明,因为我们认为我们的客户不必为了学习另一种专有脚本或编程语言而参加为期一周的研讨会。 In other words, iMacros commands refer to web page elements, so any programming logic must be put into a script that then uses iMacros to automate the website.换句话说,iMacros 命令指的是网页元素,因此任何编程逻辑都必须放入脚本中,然后使用 iMacros 来自动化网站。 - iMacros FAQ - iMacros 常见问题

You can use Javascript however it is not that good to interface with, if you are looking into browser automation I would recommend Selenium with Python.您可以使用 Javascript,但是它的接口不是很好,如果您正在研究浏览器自动化,我会推荐Selenium和 Python。 It is much easier to do anything that requires logic, iMacros is only useful for the very basic things.做任何需要逻辑的事情要容易得多,iMacros 只对非常基本的事情有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM