-
hehe = สวัสดี ("http://mmsg.qq.com/cgi-bin/gddylist?type=13&sort=1&page=3", "<html>", "</html>", "(<tdwidth =" "" 35%"" bgcolor = ""#[/dabcde] {6} ""> (.*) </td>) [./ n]*"," <fontstyle = "" Font-Size: 9pt; "" สีน้ำเงิน> $ 2 </font>
Response.writehehe
functionhello (strurl, strstart, Strend, Patrn, replstr)
str = getbody (strurl)
str = mymid (str, strstart, strend)
str = replacetest (Patrn, replstr, str)
สวัสดี = Str
endfunction
functionmymid (str, strstart, strend)
ifstrstart = "" แล้ว
i = 0
อื่น
i = instr (str, strstart)
endif
ifStreend = "" แล้ว
j = len (str)
อื่น
j = instr (i, str, strend)
endif
mymid = mid (str, i, j-i+1)
endfunction
functionReplacetest (Patrn, replstr, str1)
Dimregex, Match, Matches
setregex = newregexp
regex.pattern = Patrn
regex.ignorecase = true
regex.global = true
setMatches = regex.execute (str1)
foreachMatchinMatches
replacetest = replacetest®ex.replace (match.value, replstr)
ต่อไป
endfunction
FunctionGetBody (URL)
setObjxml = createObject ("microsoft.xmlhttp"))
withobjxml
.Open "Get", url, false, "", ""
.ส่ง
getBody = .ResponseBody
จบลงด้วย
getBody = bytestobstr (getBody, "GB2312"))
setObjxml = ไม่มีอะไร
endfunction
FunctionByTestObstr (strbody, codebase)
setObjstream = server.createObject ("adodb.stream")
withobjstream
.Type = 1
.Mode = 3
.เปิด
.writestrbody
.position = 0
.Type = 2
.Charset = codebase
bytestobstr = .readText
.ปิด
จบลงด้วย
setObjstream = ไม่มีอะไร
endfunction
-
其他调用示例:
hehe = สวัสดี ("http://list.mp3.baidu.com/Song/a.htm", "<tablewidth =" "90%" "ชายแดน =" "0" "Align =" "Center" "CellPadding =" "3" , "<divalign = center>", ".*(<tdwidth =" "20%" "> <ahref =" ".*/. htm" "target = _blank>) (.*) (</a> </td>) [./ n]*", "<fontstyle ="