asp alexa查询小偷程序(4)


   End if
End Function

Function getAlexaRank(weburl)
    tempurl=getDomainUrl(weburl)
    '读取http://client.alexa.com/common/css/scramble.css中的数据
    alexacss="http://client.alexa.com/common/css/scramble.css"
    strAlexaCss=GetHttpPage(alexacss)
    'response.write strAlexaCss
    'response.end
    alexarankqueryurl="http://www.alexa.com/data/details/traffic_details/"&tempurl

    strAlexaContent=GetHttpPage(alexarankqueryurl)

    rankcontent=getBody(strAlexaContent,"Information Service.-->","<!-- google_ad_section_end(name=default) -->",false,false)
    '获取其中的span的class
    strspan=GetArray(rankcontent,"<span class=""","""",false,false)
    'response.write rankcontent&"<br>"
    'response.write strspan&"<br>"
    'response.end
    If strspan<>"$False$" Then
        aspan=split(strspan,"$Array$")

        For i=0 To UBound(aspan)
            'response.write "."&aspan(i)
            '判定aspan(i)即span的class是否在alexacss中存在,如果存在,则需要将这个span和span中的数据去掉。
            If InStr(strAlexaCss,"."&aspan(i))>=1 Then
                'response.write aspan(i)&"<br>"
                'response.end
                '表示属性为none.需要替换掉。
                rankcontent=ScriptHtml(rankcontent,"span",2,aspan(i))
            Else
                rankcontent=ScriptHtml(rankcontent,"span",1,aspan(i))
            End if
        Next
        '替换上面少去掉的右边的span标签。
        rankcontent=Replace(rankcontent,"</span>","")

        

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/2606.html