Function GetURL(url) Set Retrieval = CreateObject("Microsoft.XMLHTTP") With Retrieval .Open "GET", url, False.Send GetURL = bytes2bstr(.responsebody)'对取得信息进行验证,如果信息长度小于100则说明截取失败if len(.responsebody)<100 thenresponse.write "获取远程文件 "&url&" 失败。"response.endend ifEnd With Set Retrieval = Nothing End Function' 二进制转字符串,否则会出现乱码的!function bytes2bstr(vin) strreturn = "" for i = 1 to lenb(vin) thischarcode = ascb(midb(vin,i,1)) if thischarcode < &h80 then strreturn = strreturn & chr(thischarcode) else nextcharcode = ascb(midb(vin,i+1,1)) strreturn = strreturn & chr(clng(thischarcode) * &h100 + cint(nextcharcode)) i = i + 1 end if next bytes2bstr = strreturn end function function savetofile(bodyall,filename)dim objstream1set objstream1=createobject("adodb.stream")objstream1.type=2objstream1.openobjstream1.position=objstream1.sizeobjstream1.writetext bodyallobjstream1.savetofile filename,2objstream1.closeset objstream1=nothingend function'声明截取的格式,从Start开始截取,到Last为结束Function GetKey(HTML,Start,Last)filearray=split(HTML,Start)filearray2=split(filearray(1),Last)GetKey=filearray2(0)End Functionurl="http://www.86516.com"Html = GetURL(Url)savetofile html,"ce.htm"
零七网部分新闻及文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与零七网进行文章共享合作。