使用imacros搜索并替换URL中的文本

问题描述

我正在尝试使用imacros来更改URL,然后让imacros使用结果来采取行动。我已经编写了以下代码,但无法使代码正常工作。 Imacros一直告诉我有错误。这是我的代码,并带有注释来解释它。也许有人可以告诉我如何正确执行此操作?

VERSION BUILD=10021450 
SET !ENCRYPTION NO 
SET !EXTRACT_TEST_POPUP NO 
SET !TIMEOUT_PAGE 900 
SET !VAR1 {{!URLCURRENT}} 
' typical example URL is http://www..net/thearchive/showimage.PHP?i=245846&catid=member&mageuser=57036 ' want to replace \\show\\ with \\edit\\ 
SET !VAR2 EVAL(""{{VAR1}}".replace(/show/g,"edit");") 
' tell browser to open the edited URL 
URL GOTO={{!VAR2}} 
' extract number between i= and &c and store it as VAR3 
SET !VAR3 {{mid({{VAR1}},inStr({{VAR1}},"i=" + 2,InStr({{VAR1}},"&ca") - (inStr({{VAR1}},"i=" + 2))}} 
' enter base URL string to start with 
SET !VAR1 http://www..net/gallery/showphoto.PHP?photo= 
' add the extracted number to the base URL string 
ADD !VAR1 {{!VAR3}} 
' tell browser to open the new URL 
URL GOTO={{!VAR1}}

对不起,我必须用***删除URL位置,因为它是一个私人站点

预先感谢您的帮助!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)