<%
hehe = hello ("http://mmsg.qq.com/cgi-ner/gddylist?type=13&sort=1&page=3", "<html>", "</html>", ".*(<tdwidth =" "" 35%"" bgcolor = ""#[/dabcde] {6} ""> (.
Antwort.WriteHehe
FunctionHello (StRURL, Strstart, Strend, Patrn, Replstr.)
STR = GETBODY (STRURL)
STR = MYMID (STR, Strstart, Strend)
STR = Ersatzest (Patrn, Replstrstr, Str)
Hallo = str
Endfunktion
Funktionmymid (str, strstart, Strend)
Ifstrstart = "" dann
I = 0
Anders
I = Instrument (str, strstart)
Endif
Ifstrend = "" dann
j = len (str)
Anders
J = Instrument (i, str, Strend)
Endif
MYMID = MID (STR, I, J-I+1)
Endfunktion
FunktionReplacetest (Patrn, Replest, Str1)
Dimregex, Match, Matches
SetRegex = newRegExp
regex.pattern = patrn
regex.ignorecase = true
regex.global = true
SetMatches = regex.execute (str1)
ForeachMatchInmatches
Ersatzsteuerung = ersatztest®ex.replace (match.value, repstr)
Nächste
Endfunktion
FunktionGetBody (URL)
SetObjxml = createObject ("microsoft.xmlhttp"))
Withobjxml
.Open "GET", URL, falsch, "," ""
.Schicken
Getbody = .ResponseBody
Endwith
Getbody = byTestObstr (getBody, "GB2312")
SetObjxml = nichts
Endfunktion
FunctionByTestObstr (Strkody, Codebasis)
SetObjstream = server.createObject ("adodb.stream")
Withobjstream
.Type = 1
.Mode = 3
.Offen
.Writestalbody
.Position = 0
.Type = 2
.CharSet = Codebase
ByTestObstr = .readText
.Schließen
Endwith
SetObjstream = nichts
Endfunktion
%>
其他调用示例 :
hehe = hello ("http://list.mp3.baidu.com/song/a.htm", "<tablewidth =" "90%" "border =" "0" "align =" "center" "cellpadding =" "3" "cellspacing =" "0" bgcolor = "#f5f5" " , "<divalign = center>", ".