使用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
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
- 最新文章
- 生根于自由的土壤-FastCGI之二[01-11]
- 用Perl语言进行Socket编程之一[01-11]
- 用Perl制作留言本实例之四[01-11]
- 用Perl制作留言本实例之二[01-11]
- 用Perl制作留言本实例之三[01-11]
- Perl语言的文字处理模式之三(3)[01-11]
- 相关文章
- 生根于自由的土壤-FastCGI之二[01-11]
- 本地调试PERL CGI程序之二[01-11]
- 本地调试PERL CGI程序之一[01-11]
- 在CGI中实现session的想法和实现[01-11]
- CGI绝对路径和相对路径的简便设置方法[01-11]
- CGI的安全(二)[01-11]
