使用脚本下载网页

2008-04-07 09:33:28 北京时间
// 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>(.*)<\/title>/i; 
// Execute the regular expression on the raw HTML 
var title = rtitle.exec( s ); 
// Display the result 



最新图文资讯

发表评论

请文明参与讨论,禁止漫骂攻击。本站保留不刊登无关和不雅评论的权力。


用户名: 密码: 匿名

相关新闻
最近在用perl+mdbm+spread做东西。 php是用了很久了,python和rub
//TheURLtodownload varurl=http://www.aboutnt.com/default.htm
要在自己的平台上调试PERL CGI程序,以中文Win98为例,需要做以
---- 1 Perl5.0的某些语法 ----为了方便大家对后面内容的理解,
很多的cgi程序的绝对路径和相对路径都可以可采用相对的形式来书

广告
© 2008 The Czz5 Company. All Rights Reserved. 关于我们 - 联系我们 - 广告业务 - 网站地图 - 版权声明 - 友情连接 - 网站投稿 - 致信编辑