国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

asp采集抓取網(wǎng)上房產(chǎn)信息的代碼

2024-05-04 10:57:28
字體:
供稿:網(wǎng)友
復(fù)制代碼 代碼如下:

<%@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
'========================================================
'字符編碼函數(shù)
'====================================================
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 
'取行字符串在另一字符串中的出現(xiàn)位置
Function Newstring(wstr,strng) 
Newstring=Instr(lcase(wstr),lcase(strng)) 
if Newstring<=0 then Newstring=Len(wstr) 
End Function 
'替換字符串函數(shù)
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"'新聞網(wǎng)址
getcont=ReadXml(url,"gb2312","<table class=k2 border=""0""","</table>")
getcont=RegexHtml(getcont)
dim KeyId,NewsClass,City,Position,HouseType,Level,Area,Price,Demostra
dim ContactMan,Contact
for i=2 to ubound(getcont)
response.Write(getcont(i)&"__<br>")

tempLink=mid(getcont(i),instr(getcont(i),"href=""")+6,instr(getcont(i),""" 
onClick")-10)
tempLink=replace(tempLink,"../","")
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 泾源县| 水城县| 扶绥县| 上犹县| 纳雍县| 姜堰市| 道孚县| 富平县| 德清县| 嵊泗县| 丹东市| 万荣县| 九江县| 佛冈县| 南乐县| 即墨市| 蒙自县| 漠河县| 孝感市| 婺源县| 安宁市| 渭源县| 康保县| 曲沃县| 安达市| 沛县| 蕲春县| 邵阳市| 丹江口市| 蒲城县| 措勤县| 伊川县| 五峰| 清新县| 石嘴山市| 庐江县| 庐江县| 马鞍山市| 博白县| 恩平市| 武胜县|