imacros,创建文件夹结构为EXTRACT为HREF根

时间:2015-06-24 14:17:27

标签: image save structure directory imacros

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个声明才能发布)

我的所有图片都保存到:

D:\temp\img\

如何让imacros将此图像保存到

D:\temp\img\78\403\11132\1\279\seagate-ext-drive-(1).jpg
D:\temp\img\78\403\11132\1\279\seagate-ext-drive-(2).gif
D:\temp\img\78\403\11132\1\279\i\seagate-ext-drive-small-(1).gif
D:\temp\img\78\403\11132\1\279\i\seagate-ext-drive-small-(2).jpg

我重复从TAG 1到TAG 4的代码以获得4张图像

1 个答案:

答案 0 :(得分:0)

试试这段代码:

var factory = GetConnectionFactory();
var connection = factory.CreateConnection("username", null);