Board logo

标题: 用什么工具来提取页面中的所有的超链接? [打印本页]

作者: bosinl2004     时间: 2009-4-16 09:06    标题: 用什么工具来提取页面中的所有的超链接?

请问用什么工具可以来提取页面中的所有的超链接?

比如 geturl 1.htm 1.txt
就是把1.htm中包含的超链接都提取到1.txt中去了。
作者: tireless     时间: 2009-4-16 09:38
CODE:  [Copy to clipboard]
geturls.exe < 1.htm > 1.txt
http://rthost.fam.cx/cndos-up/img/1407.zip
作者: darkkid     时间: 2009-4-16 09:39
这么简单的需求,应该无需要特殊工具,批处理应该就ok

[ Last edited by darkkid on 2009-4-16 at 09:44 ]
作者: freeants001     时间: 2009-4-16 09:52
LS,这么好的东西不用,我收下了,呵~~~
作者: freeants001     时间: 2009-4-16 10:18
CODE:  [Copy to clipboard]
sss=WScript.createobject("scripting.filesystemobject").opentextfile("你的文件.txt",1).readall()
fl=WScript.createobject("scripting.filesystemobject").createtextfile("url.txt",2,true)
re=/(?:http|https|ftp|mms|rtsp):\/\/(?:&(?=amp;)|[A-Z0-9\.\/=\?%_~@#:;\+\- ]){1,250}/gi
while((arr=re.exec(sss))!=null)fl.writeline(arr);

作者: sady2009     时间: 2009-4-16 23:49
正需要.很好用.谢谢2楼提供
作者: wcf147     时间: 2010-4-30 00:02


  Quote:
Originally posted by freeants001 at 2009-4-16 10:18:
[code]sss=WScript.createobject("scripting.filesystemobject").opentextfile("你的文件.txt",1).readall()
fl=WScript.createobject("scripting.filesystemobject").create ...

我是新手
不知道如何用
作者: 740011611     时间: 2010-4-30 20:22
链接失效了
作者: yishanju     时间: 2010-4-30 21:37


  Quote:
Originally posted by 740011611 at 2010-4-30 20:22:
链接失效了

http://rthost.fam.cx/cndos-up/img/1407.zip

作者: yonghu111     时间: 2010-5-1 00:13
正则就行
作者: freeants001     时间: 2010-5-1 19:03
更新下5楼JS代码:P
CODE:  [Copy to clipboard]
srcFile = "test.txt";
dstFile = srcFile + "_url.txt";
fso=WScript.createobject("Scripting.FileSystemObject");
sss=fso.opentextfile(srcFile,1).readall();
fl=fso.createtextfile(dstFile,1,false);
re=/(["']?)((?:http|https|ftp|mms|ed2k|Flashget|thunder|rtsp):\/\/(?:[][@!\w\/(&=.*?)+|`%~:;\-,$\'])+)\1/g;
while((arr=re.exec(sss))!=null)fl.writeline(arr[2]);
[ Last edited by freeants001 on 2010-5-1 at 19:47 ]




欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) Powered by Discuz! 2.5