最新下载
热门教程
- 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
相关文章
- 新三国志曹操传南华幻境天境第9层第1关怎么打 第9层第1关打法教学 09-17
- 下一站江湖2风神腿怎么获得 风神腿获取方法 09-17
- 鹅鸭杀保镖的作用 保镖技能介绍 09-17
- 二重螺旋扶疏怎么培养 扶疏养成攻略 09-17
- 二重螺旋妮弗尔夫人怎么玩 妮弗尔夫人玩法教学 09-17
- 对决剑之川哪些角色好用 对决剑之川角色推荐 09-17