使用的是excel的自建函数 打开excel 打开宏 输入一下内容 Function Title(ByVal url As String) As String
On Error Resume Next
url = "http://" & Replace(url, "http://", "") With CreateObject("Msxml2.XMLHTTP")
.Open "get", url, False
.send
Title = Split(Split(.responsetext, "<title>")(1), "</title>")(0)
End With
End Function
保存 在a1单元格输入网址url 注意要http://开头 在别的地方输入函数title例如 在输入任何title(A1)就可以提取网站的标题了 同理可以改变函数为 Function Meta(ByVal url As String) As String
On Error Resume Next
url = "http://" & Replace(url, "http://", "")
With CreateObject("Msxml2.XMLHTTP")
.Open "get", url, False
.send
Meta = Split(Split(.responsetext, "<meta name=""description"" content=""")(1), """")(0)
End With
End Function
|