xmlhttp 抓取网页内容1
来源:互联网 发布:java异或加密解密 编辑:程序博客网 时间:2024/05/25 20:00
<%
On Error Resume Next
Server.ScriptTimeOut=9999999
Function getHTTPPage(Path)
t = GetBody(Path)
getHTTPPage=BytesToBstr(t,"GB2312")
End function
Function bytes2BSTR(vIn)
strReturn = ""
For j = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,j,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,j+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
j = j + 1
End If
Next
bytes2BSTR = strReturn
End Function
Function GetBody(url)
on error resume next
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
Retrieval.Open "Get", url, False, "", ""
Retrieval.Send
GetBody =Retrieval.responsebody
Set Retrieval = Nothing
End Function
Function BytesToBstr(body,Cset)
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 = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
Function Newstring(wstr,strng)
Newstring=Instr(lcase(wstr),lcase(strng))
if Newstring<=0 then Newstring=Len(wstr)
End Function
%>
<%
Dim wstr,str,url,start,over,city
city = Request.QueryString("id")
url="http://cn.finance.yahoo.com/q?s=USDKRW=X&d=c"
wstr=getHTTPPage(url)
start=Newstring(wstr,"最後交易")
over=Newstring(wstr,"买方出价")
body=mid(wstr,start,over-start)
start2=Instr(body,"<b>")+3
over2=Instr(body,"</b>")
body2=mid(body,start2,over2-start2)
response.write body2
%>
- xmlhttp 抓取网页内容1
- xmlhttp 抓取网页内容2
- asp 利用 xmlhttp 抓取网页内容
- ASP利用XMLHTTP抓取网页内容
- asp通过xmlhttp抓取网页内容不完整
- Asp 使用 Microsoft.XMLHTTP 抓取网页内容无乱码处理,并过滤需要的内容
- vbs+xmlhttp获取网页内容
- Jsoup网页内容抓取分析(1)
- 通过urllib2抓取网页内容(1)
- JAVA 抓取网页内容
- 【JAVA】 抓取网页内容
- 网页内容抓取
- 网页内容抓取
- fsockopen 抓取网页内容
- JAVA 抓取网页内容
- 抓取网页内容
- lotusscript 抓取网页内容
- C# 抓取网页内容
- [Music]Lonely
- XML入门-为什么创建 XML
- Marketing tactics of e-commerce
- 编写可移植数据访问层
- “瑜珈山夜话” ----内存分配(一)
- xmlhttp 抓取网页内容1
- ASP六大对象介绍
- [Music]加州旅馆
- ASP.NET 动态生成 HTML 页面
- 1.4 - [intro.compliance] - 【介绍.遵从性】
- 保留的图形对象(Retained Graphic Objects)API 简介
- 一些珍藏代码奉献,绝对有价值,不可不看!!!
- 对黑洞的疑惑
- xmlhttp 抓取网页内容2