Someone recently asked how to use ASP to get another Web page, and analysis of the use of its data, pure ASP is not to do this, so I used VC to do an HTTP component, very simple, as asphttp, because the time problem I did not do post method, can only use Get method, But it is more than enough to deal with big search engines like Yahoo and Sina. Use this component to send requests to these stations, and then use the ASP analysis and get useful data, the analysis of the idea is to use the logo bit, if you want to do general-purpose, you can use the configuration file. I will not explain more, see examples. My component and source code download address is as follows:
Component: Http://homepage.qdcatv.com.cn/bigeagle/myhttp.zip
Source code: Http://homepage.qdcatv.com.cn/bigeagle/myhttpcode.zip
The following is an ASP example program, the search engine is using Yahoo
Test2.asp
<%@ Language=vbscript%>
<HTML>
<HEAD>
<meta name= "generator" content= "Microsoft Visual Studio 6.0" >
</HEAD>
<BODY>
<form action= "test1.asp" method= "Get" >
<input type=text name= "keyword" >
<input type=submit value= "Find" >
</form>
</BODY>
</HTML>
Test1.asp
<%
Dim m_objmyhttp, M_strhtml
Set m_objmyhttp = Server. CreateObject ("Myhttp.") OpenURL ")" Create object
' Accept page parameters
M_strkeyword = Server. UrlEncode (Trim (request.querystring ("keyword"))
' Request to Yahoo to send search keyword ' c + + '
M_objmyhttp.url = "http://search.yahoo.com/bin/search?p=" &m_strKeyword& ""
' Send request
M_objmyhttp.sendrequest ()
' Take HTML to a local variable
m_strhtml = m_objmyhttp.html
Set m_objmyhttp = Nothing
' Analysis, use of logo bits
Dim M_strbegintag, M_strendtag, m_strURL
' Set flag bit
M_strbegintag = "<table border=0 cellpadding=0 cellspacing=0><tr><td height=5></td></tr ></table><dd><li> "
M_strendtag = "</a>"
M_intbegin = 1
M_intend = 0
Do as not M_intbegin = 0
M_intbegin = InStr (M_intbegin + 1, m_strhtml, M_strbegintag)
M_intend = InStr (M_intbegin + len (m_strbegintag), m_strhtml, M_strendtag)
m_strURL = Mid (m_strhtml, M_intbegin+len (M_strbegintag), M_intend-m_intbegin-len (M_strbegintag) +4)
If M_intbegin <> 0 Then
Response.Write m_strURL + "<br>"
End If
Loop
%>