是这样,我写了个小exe,作用是从输入文件中,过滤出含有特定标记的字符串。
例如,通过如下调用:
getkeystr.exe -cmd="call sub_get_jpg.bat " -i=D:\wallcoo.com\html\3.html -bs="您的位置:<a href" -be="../ad.js" -s="../" -e=".jpg" -k="Bwallcoo.com" 1>b:\tmp.bat
能从输入文件(例如http://www.wallcoo.com/star/Saki_Seto/html/image5.html)中,过滤出:
img src="../mxxx01/%5Bwallcoo.com%5D_Saki_Seto_picture_14.jpg"
并生成tmp.bat文件内容如下:
call sub_get_jpg.bat tmp0 mxxx01/%5Bwallcoo.com%5D_Saki_Seto_picture_14
现在的问题就是,怎么写这个sub_get_jpg.bat ,能正确下载这个图片哪?
我原来写的sub_get_jpg.bat 的内容是:
wget.exe --user-agent="Mozilla/4.0 (compatible; MSIE 6.0; Windws NT 5.1)" --cookies=on "%URL_BASE%/%2.jpg" -O%STORE_PATH%\jpg%1.jpg
其中已经在之前的批处理中设置为类似:
set URL_BASE=http://www.wallcoo.com/star/Saki_Seto