Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall
Experience exchange of Acquisition programming (II.)--download page (1)
"Small sites do not need maintenance, just because your program is too stupid, so you become an endless website maintainer." ”
Web download Method 1 (XMLHTTP application)
Objects to use: XMLHTTP, just three lines of code, you can complete the Web download:
First step: Create an Object
Set ms = CreateObject ("Microsoft.XMLHTTP")
This line of code is used to create a XMLHTTP object, where MS is the name of the object to create, ASP programming is often used, you can write casually, no longer repeat.
Step two: Set the parameters
Ms.open "Get", Url,false
Where the URL is to download the Web page URL, replace it with your target Web site can be, the format is: http://www.99jpw.cn, must write complete, can not omit http://;
"Get" is an open method, and of course it can be post, with the same effect as the form submission in HTML.
Step three: Send data
Ms. Send ()
This line of code is used to send and download data, and the downloaded data is stored in the variable responsebody.
Below we download "Dot Point ticket Network (http://www.66666999.com)" Home as an example to explain
Code:
Set ms = CreateObject ("Microsoft.XMLHTTP")
Ms. Open ' get ', ' http://www.99jpw.cn ', False
Ms. Send ()
Response.Write Ms.responsebody
Run the above code you can find that we have successfully downloaded the http://www.66666999.com
Here's a question to note, 8630.html "> Sometimes the site is very long, directly added to the second line of code will appear very messy, then we can use a variable to replace the following:
Url= "http://www.99jpw.cn"
Set ms = CreateObject ("Microsoft.XMLHTTP")
Ms. Open ' get ', url, False
Ms. Send ()
Response.Write Ms.responsebody
The code has become much neater.