imacros,将文件夹结构创建为 EXTRACT 作为 HREF 根目录

imacros, create folder structure as EXTRACT as HREF root

TAG POS=4 TYPE=IMG ATTR=STYLE:margin:*15px*&&SCR:*&&ALT:* EXTRACT=HREF
ONDOWNLOAD FOLDER=D:\temp\img\ FILE=* WAIT=YES
TAG POS=4 TYPE=IMG ATTR=SRC:/upload/images/* CONTENT=EVENT:SAVEPICTUREAS

使用上面的代码, EXTRACT HREF 得到:

"http://ext-domain.com/images/products/78/403/11132/1/279/seagate-ext-drive-(1).jpg"

实际上页面上有不止一张图片,名称和扩展名不同

"http://ext-domain.com/images/products/78/403/11132/1/279/seagate-ext-drive-(1).jpg"
".. same as above....................................... /seagate-ext-drive-(2).gif"
".. same as above....................................... /i/seagate-ext-drive-small-(1).gif"
".. same as above....................................... /i/seagate-ext-drive-small-(2).jpg"

(抱歉 .. same as above.. is ..http.../78/403/11132/1/279/.. ,因为还需要 10 个声望才能 post )

我所有的图片都保存到:

D:\temp\img\

如何让imacros将这张图片保存到

D:\temp\img31329\seagate-ext-drive-(1).jpg
D:\temp\img31329\seagate-ext-drive-(2).gif
D:\temp\img31329\i\seagate-ext-drive-small-(1).gif
D:\temp\img31329\i\seagate-ext-drive-small-(2).jpg

我重复从TAG 1到TAG 4的代码得到4张图片

试试这个代码:

SET myFolder D:\temp\img\
TAG POS=4 TYPE=IMG ATTR=SRC:/upload/images/* EXTRACT=HREF
SET !EXTRACT EVAL("'{{!EXTRACT}}'.match(/\/upload\/images\/(.*)image\.jpg/)[1];")
SET !EXTRACT EVAL("'{{!EXTRACT}}'.replace(/\//g, '\\');")
ADD myFolder {{!EXTRACT}}
ONDOWNLOAD FOLDER={{myFolder}} FILE=image.jpg WAIT=YES
TAG POS=4 TYPE=IMG ATTR=SRC:/upload/images/* CONTENT=EVENT:SAVEPICTUREAS