登录  注册   充值   
  • 免费网络工具在线检测

为什么选择我们

  • 国内主机免费备案
  • 15年优质服务经验
  • 超强主机控制面板
  • 虚拟主机自动开通
  • 独家文件监控功能
  • 100G高速带宽接入
  • 专业DDOS攻击防火墙
  • 自主防DDOS攻击系统
  • 专业的网络安全维护
  • 高性能集群至强服务器
  • 全年365天不间断运行
  • 7*24小时技术维护
  • 常见程序免费预安装
  • 免费赠送企业邮箱

如何获取网页标题的ASP代码
 
发布时间:2023-10-11 13:26:06
 
如何获取网页标题的ASP代码

<%
Function getHTTPPage(url)
on error resume next
dim http
set http=Server.createobject("Msxml2.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytes2BSTR(Http.responseBody)
set http=nothing
if err.number<>0 then
err.Clear
end if
End Function

Function bytes2BSTR(vIn)
dim strReturn
dim i,ThisCharCode,NextCharCode
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 GetPageTitle(HtmlContent)
Dim l,j,strTitle
l = InStr(LCase(HtmlContent), "<title>")
If l > 0 Then
l = l + 7
j = InStr(l, LCase(HtmlContent), "</title>")
If j > 0 Then
strTemp = Mid(HtmlContent, l, j - l)
Else
strTemp = "无法获取网页标题!"
End If
Else
strTemp = "无法获取网页标题!"
End If
GetPageTitle = strTemp
End Function

HtmlCldeContent = getHTTPPage("https://www.ietdata.com") '要提取页面的url地址
Title = GetPageTitle(HtmlCldeContent)
response.write(Title)
%>
   因尔特网络数据中心 18年老牌idc服务商为你提供云主机、高防服务器、虚拟主机、域名、网站建设、APP制作、SSL证书等,欢迎咨询!

 
 
企业微信