使用脚本下载网页

// 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 = /

1<title>(.*)&lt;\/title&gt;/i;   
2// Execute the regular expression on the raw HTML   
3var title = rtitle.exec( s );   
4// Display the result</title>
Published At
Categories with Web编程
Tagged with
comments powered by Disqus