コードコピーは次のとおりです。
<%@言語= "vbscript" codepage = "936"%>
<! - #includefile = "conn.asp" - >
<! - #includefile = "inc/function.asp" - >
<!doctypehtmlpublic " - // w3c // dtdhtml4.01transitional // en"
"http://www.w3.org/tr/html4/loose.dtd">
<html>
<head>
<title> untitleddocument </title>
<metahttp-equiv = "content-type" content = "text/html; charset = gb2312">
<metahttp-equiv = "reffery" content = "300; url = steal_house.asp">
</head>
<body>
<%
onerrorresumenext
'
server.scripttimeout = 999999
'===========================================================================================================
'文字エンコード関数
'==================================================================================
functionbytestobstr(body、code)
DimobjStream
setobjstream = server.createObject( "adodb.stream")
objstream.type = 1
objstream.mode = 3
objstream.open
objstream.writebody
objstream.position = 0
objstream.type = 2
objstream.charset = code
bytestobstr = objstream.readtext
objstream.close
setobjstream =何もない
エンド機能
「別の文字列にライン文字列の発生位置を取得します
functionnewstring(wstr、strng)
新聞= string(lcase(wstr)、lcase(strng))
ifnewstring <= 0thennewstring = len(wstr)
エンド機能
'文字列関数を交換します
functionReplacestr(ori、str1、str2)
交換型=交換(ori、str1、str2)
エンド機能
'==================================================================================
functionreadxml(url、code、start、ends)
setosend = createObject( "microsoft.xmlhttp")
sourcecode = osend.open( "get"、url、false)
osend.send()
readxml = bytestobstr(osend.responsebody、code)
start = struns(readxml、start)
readxml = mid(readxml、start)
end = strust(readxml、end)
readxml = left(readxml、end-1)
エンド機能
functionsubstr(body、start、end)
start = strunt(body、start)
substr = mid(body、start+len(start)+1)
end = strust(substr、end)
substr = left(substr、end-1)
エンド機能
DimgetCont、NewsContent
Dimurl、タイトル
url = "http://www.***.com" 'ニュースWebサイト
getCont = readxml(url、 "gb2312"、 "<tableclass = k2border =" "0" "、" </table> ")
getCont = regexhtml(getCont)
DimkeyId、Newsclass、City、Position、HouseType、Level、Area、Price、Demostra
dimcontactman、連絡先
fori = 2toubund(getCont)
respons.write(getCont(i)& "__ <br>")
templink = Mid(getCont(i)、strunt(getCont(i)、 "href =" "")+6、strust(getCont(i)、 "" "
onclick ")-10)
templink = cheplage(templink、 "../"、 "")
Response.write(i& ":"&templink& "<br>")