原文網址:利用asp擷取網頁資料

如何利用ASP抓取網頁資料並且顯示中文的問題,有興趣的歡迎參考: 

<%@ language=VBScript%>


Get HTML Source Code - Copyright (C) Dhandapani Ammasai 

Enter a URL: 

<% dim objXMLHTTP URL = Request.form("URL") if ( URL = "" ) then URL = "http://tw.yahoo.com/" end if Set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP") objXMLHTTP.Open "GET", URL, false objXMLHTTP.Send strTmp = bytesToBSTR(objXMLHTTP.responseBody,"big5") Response.Write "


" Response.Write "

HTML Code for "&URL&"

" Response.Write "" Set objXMLHTTP = Nothing 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 %>

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 kingjoy1235 的頭像
    kingjoy1235

    King的幸福國度

    kingjoy1235 發表在 痞客邦 留言(0) 人氣()