新手求助,以下代码是什么意思?有什么作用
以下代码是什么意思?有什么作用??
<%
On Error Resume Next
Server.ScriptTimeOut=360
Function BytesToBstr(body,Cset)
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
Function getHtmls(url,code)
on error resume next
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", url, False, "", ""
.Send
getHtmls = BytesToBstr(.ResponseBody ,code)
End With
Set Retrieval = Nothing
End Function
Dim url , str
On Error Resume Next
url="http://www.116.com/?q="& keyword
str = getHtmls(url,"utf-8")
set regEx = new RegExp
regEx.Pattern= "<div class=""dig"">(.+?)</div>"
regEx.IgnoreCase = True
regEx.Global = True
Set Matches=regEx.Execute(str)
response.Write("<ul>"&vbcrlf)
For Each Matche In Matches
response.Write "<li>"& Matche &"</li>"&vbcrlf
next
response.Write("</ul>"&vbcrlf)
%>
[解决办法]
asp下使用adodb.stream、XML以及正则表达式。
[解决办法]
抓取网页内容并解析出一定的格式。
[解决办法]
抓取哪个网页的内容内看出来吗
[解决办法]
url="http://www.116.com/?q="& keyword
str = getHtmls(url,"utf-8")