本帖最后由 pcl_test 于 2016-11-13 20:32 编辑
举个栗子- //&cls&mshta "%~f0">"结果.txt"&pause&exit
-
- <script src=http://www.bathome.net/lib/diy/Function.js></script>
- <script>
- var fso = new ActiveXObject('Scripting.Filesystemobject');
- var StdOut = fso.GetStandardStream(1);
- var url = 'http://www.55188.com/';
- //1到10页
- for(var i=1;i<=10;i++){
- var txt = '', u = url+ 'forum-111-'+ i +'.html';
- var links = web(u).match(/<span\sid=\"thread_\d+\"[^>]+?>[\s\S]+?<\/span>/g);
- for(var j=0;j<links.length;j++){
- var link = links[j].match(/<a href="([^"]+)/)[1];
- var title = links[j].replace(/<[^>]*>/g, '');
- txt +=url + link + ' '+ title +'\r\n';
- }
- StdOut.Write('page '+i+'\r\n'+txt+'\r\n');
- }
- close();
- </script>
复制代码
|