<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!-- #include file="conn.asp" -->
<!-- #include file="inc/function.asp" -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="refresh" content="300;URL=steal_house.asp">
</head>
<body>
<%
on error resume next
'
Server.ScriptTimeout = 999999
'=============================================================================
'character encoding function
'========================================================================
Function BytesToBstr(body,code)
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 =code
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
'Fetch the line string's occurrence position in another string
Function Newsstring(wstr,strng)
Newsstring=Instr(lcase(wstr),lcase(strng))
if Newsstring<=0 then Newsstring=Len(wstr)
End Function
'Replace string function
function ReplaceStr(ori,str1,str2)
ReplaceStr=replace(ori,str1,str2)
end function
'========================================================================
function ReadXml(url,code,start,ends)
set oSend=createobject("Microsoft.XMLHTTP")
SourceCode = oSend.open ("GET",url,false)
oSend.send()
ReadXml=BytesToBstr(oSend.responseBody,code)
start=Instr(ReadXml, start)
ReadXml=mid(ReadXml, start)
ends=Instr(ReadXml,ends)
ReadXml=left(ReadXml, ends-1)
end function
function SubStr(body,start,ends)
start=Instr(body,start)
SubStr=mid(body,start+len(start)+1)
ends=Instr(SubStr,ends)
SubStr=left(SubStr,ends-1)
end function
dim getcont,NewsContent
dim url, title
url="http://www.***.com"'News URL Knowsky.com
getcont=ReadXml(url,"gb2312","<table class=k20"","</table>")
getcont=RegexHtml(getcont)
dim KeyId, NewsClass, City, Position, HouseType, Level, Area, Price, Demostra
dim ContactMan,Contact
for i=2 to ubund(getcont)
response.Write(getcont(i)&"__<br>")
tempLink=mid(getcont(i),instr(getcont(i),"href=""")+6,instr(getcont(i),""" onClick")-10)