敬业的IT人 >> 网站建设 >> Web编程 >> CGI/Perl >> 使用CGI脚本实现下载网页[代码]

使用CGI脚本实现下载网页[代码]

敬业的IT人 互联网 佚名 2008-1-11 9:42:14
// The URL to download 
var url = http://www.cncms.com.cn/index.html 
// 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 
粤ICP备06119539号
Copyright CiscoSky.Org,Some Rights Reserved.
Email:me1228#tom.com