最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp 抓取alexa 网站世界排名代码
时间:2022-07-02 23:06:06 编辑:袖梨 来源:一聚教程网
抓取alexa 网站世界排名代码
function Alexa(AlexaURL)
on error resume next
dim getsms,getstr,url
dim star,endd
url="
getsms=getHTTPPage(url)
if getsms"" then
star=instr(getsms,"
getstr=mid(getsms,star,endd-star-4)
else
getstr="无排名"
end if
if IsNumeric(getstr)=false then getstr="无排名"
Alexa=getstr
end function
function getHTTPPage(url)
on error resume next
dim http
set http=Server.createobject("Microsoft.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate4 then
getHTTPPage=""
exit function
end if
getHTTPPage=bytes2BSTR(Http.responseBody)
set http=nothing
if err.number0 then err.Clear
end function
Function bytes2BSTR(vIn)
dim strReturn
dim i1,ThisCharCode,NextCharCode
strReturn = ""
For i1 = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i1,1))
If ThisCharCode
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i1+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i1 = i1 + 1
End If
Next
bytes2BSTR = strReturn
Err.Clear
End Function
相关文章
- 第一狂战士卡赞土罐具体位置介绍说明 10-01
- 第一狂战士卡赞狂龙赫斯机制介绍及打法分享 10-01
- 第一狂战士卡赞蝰蛇机制介绍及打法分享 10-01
- 第一狂战士卡赞强力开荒套装获取方法 10-01
- 第一狂战士卡赞强力流派加点攻略分享 10-01
- 撩人的情话套路短句一问一答 10-01