使用脚本下载网页

来源:网页教学基地 时间:2007-02-27 01:21:53  浏览次数:0
/**
* Script: dlwebpage.js
* Purpose: Downloads the webpage specified by 'url'
* Author: Daren Thiel
* Date: 17 May 1999
*
* Note: Rename this script dlwebpage.js
* Web: http://www.winscripter.com
* Copyright 1999 Daren Thiel
**/

// The URL to download
var url = "http://www.aboutnt.com/default.htm"

// Create instance of Inet Control
inet = new ActiveXObject("InetCtls.Inet");

// Set the timeout property
inet.RequestTimeOut = 20;

// Set the URL property of the control
inet.Url = url;

// Actually download the file
var s = inet.OpenURL();

// Show the raw HTML to the user
WScript.Echo( s );

// Bonus - Find the title of the page
// Regular expression to find the string stored between
// the title tags.
rtitle = /(.*)<\/title>/i; <br> <br>// Execute the regular expression on the raw HTML <br>var title = rtitle.exec( s ); <br> <br>// Display the result <br>WScript.Echo( RegExp.$1</div> <div id="keyword"><strong>关键词:</strong><a href="/tag.php?tag=%CA%B9%D3%C3%BD%C5%B1%BE%CF%C2%D4%D8%CD%F8%D2%B3" class="keyword">使用脚本下载网页</a></div> <div class="ads2"><script language="javascript" type="text/javascript" src="/js/newse.js"></script></div> <script type="text/javascript"> document.body.oncopy = function () { setTimeout( function () { var text = clipboardData.getData("text"); if (text) { text = text + "本文来自:网页教学基地(www.wyzu.cn)原文链接:"+location.href; clipboardData.setData("text", text); } }, 100 ) } </script></div> <div class="clear"></div> <div class="clear"></div> <div id="toollinks"> <script type="text/javascript"> var clipBoardContent = document.URL; function copyUserHomeToClipBoard() { window.clipboardData.setData("Text",clipBoardContent); alert("复制成功,请粘贴到你的QQ/MSN上推荐给你的好友!内容如下:" + clipBoardContent); } </script> <a title="复制本文链接发给你QQ/MSN上的好友" href="JavaScript: copyUserHomeToClipBoard()" rel="nofollow">复制链接发给好友</a><a href="#top">返回顶部</a><a title="加入到收藏夹" href="javascript:window.external.AddFavorite(document.location.href,'使用脚本下载网页')">收藏本文</a><a href="javascript:window.close()">关闭此页</a></div> <div class="clear"></div> </div> <div id="otherentry"> </div> </div> <div id="relatedarticle"> <div class="relatitle">最近相关</div> <ul> </ul> <div class="clear"></div> </div> </div> <div id="rail"> <div id="recommand"> <ul> <SCRIPT LANGUAGE="JavaScript" src="/js/3.js"></SCRIPT> </ul> <div class="clear"></div> </div> <div class="rightlist"> <div class="titlebgr">阅读排行</div> <ul> <li><span>[2007-02-19]</span><a title="CGI 站内搜索" target="_blank" href="/data/2007/0219/article_11734.html">CGI 站内搜索</a></li> <li><span>[2007-02-27]</span><a title="建立个人服务器 脱机调试CGI脚本" target="_blank" href="/data/2007/0227/article_28289.html">建立个人服务器 脱机调试CGI脚本</a></li> <li><span>[2008-11-05]</span><a title="Perl CGI 环境变量列表" target="_blank" href="/data/2008/1105/article_32563.html">Perl CGI 环境变量列表</a></li> <li><span>[2007-02-19]</span><a title="Perl在WAP网站中应用实例一谈" target="_blank" href="/data/2007/0219/article_11759.html">Perl在WAP网站中应用实例一谈</a></li> <li><span>[2007-02-19]</span><a title="网络安全系列知识之CGI漏洞攻击合集上" target="_blank" href="/data/2007/0219/article_11820.html">网络安全系列知识之CGI漏洞攻击...</a></li> <li><span>[2007-02-27]</span><a title="在windowsnt上实现cgi" target="_blank" href="/data/2007/0227/article_28291.html">在windowsnt上实现cgi</a></li> <li><span>[2007-02-19]</span><a title="LB5000XP论坛配合SERV-U获取系统管理员权限" target="_blank" href="/data/2007/0219/article_11777.html">LB5000XP论坛配合SERV-U获取系...</a></li> <li><span>[2007-02-19]</span><a title="在Perl/CGI中使用模板" target="_blank" href="/data/2007/0219/article_11782.html">在Perl/CGI中使用模板</a></li> <li><span>[2007-02-19]</span><a title="Windows95/98,NT下如何发EMAIL" target="_blank" href="/data/2007/0219/article_11750.html">Windows95/98,NT下如何发EMAIL</a></li> <li><span>[2007-02-19]</span><a title="perl常问问题集--第1篇" target="_blank" href="/data/2007/0219/article_11814.html">perl常问问题集--第1篇</a></li> </ul> <div class="clear"></div> </div> <div class="ads3"><script language="javascript" type="text/javascript" src="/js/newsr1.js"></script></div> <div class="rightlist"> <div class="titlebgr">推荐文章</div> <ul> </ul> <div class="clear"></div> </div> <div class="ads4"><script language="javascript" type="text/javascript" src="/js/newsr2.js"></script></div> <div class="rightlist"> <div class="titlebgr">最新更新</div> <ul> <li><span>[2008-11-05]</span><a title="Perl CGI 环境变量列表" target="_blank" href="/data/2008/1105/article_32563.html">Perl CGI 环境变量列表</a></li> <li><span>[2008-10-05]</span><a title="perl的5个常见错误" target="_blank" href="/data/2008/1005/article_32356.html">perl的5个常见错误</a></li> <li><span>[2007-02-27]</span><a title="对ikonboard v2.1.9物理路径泄露的分析" target="_blank" href="/data/2007/0227/article_28296.html">对ikonboard v2.1.9物理路径泄...</a></li> <li><span>[2007-02-27]</span><a title="使用脚本下载网页" target="_blank" href="/data/2007/0227/article_28295.html">使用脚本下载网页</a></li> <li><span>[2007-02-27]</span><a title="申请14个CGI程序服务" target="_blank" href="/data/2007/0227/article_28294.html">申请14个CGI程序服务</a></li> <li><span>[2007-02-27]</span><a title="用VB编写标准CGI程序" target="_blank" href="/data/2007/0227/article_28292.html">用VB编写标准CGI程序</a></li> <li><span>[2007-02-27]</span><a title="在windowsnt上实现cgi" target="_blank" href="/data/2007/0227/article_28291.html">在windowsnt上实现cgi</a></li> <li><span>[2007-02-27]</span><a title="在自己的电脑上调试PerlCGI程序" target="_blank" href="/data/2007/0227/article_28290.html">在自己的电脑上调试PerlCGI程序</a></li> <li><span>[2007-02-27]</span><a title="建立个人服务器 脱机调试CGI脚本" target="_blank" href="/data/2007/0227/article_28289.html">建立个人服务器 脱机调试CGI脚本</a></li> <li><span>[2007-02-27]</span><a title="如何在Win95/98/NT上调试CGI程序" target="_blank" href="/data/2007/0227/article_28288.html">如何在Win95/98/NT上调试CGI程序</a></li> </ul> <div class="clear"></div> </div> <div class="ads5"><script language="javascript" type="text/javascript" src="/js/newsr3.js"></script></div> </div> </div> <script language="JavaScript" src="/count.php?contentid=28273"></script> <SCRIPT LANGUAGE="JavaScript" src="/js/4.js"></SCRIPT> <div id="footer"> <div id="footerinfo"> <div id="footercontent"><a href="/data/page/1.html">关于我们</a> - <a href="/data/page/2.html">联系方式</a> - <a href="/data/page/3.html">版权声明</a> - <a href="/data/page/4.html">网站地图</a> - <a href="/data/friendsite/">友情链接</a> </div> <div id="footercopyrights"><span>Copyright © 2007-2010 www.wyzu.cn . All rights reserved. </span><a href="http://www.miibeian.gov.cn">陕ICP备05014816号</a><SCRIPT LANGUAGE="JavaScript" src="/js/foote.js"></SCRIPT></div> </div> </div> </body> </html>