Excel VBA中的HTML页面标题 [英] HTML Page Title in Excel VBA
本文介绍了Excel VBA中的HTML页面标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
例如假设我有三个网址,如:
现在我需要在另一列中获取这些html页面的标题。我如何做?
解决方案
我不知道你的标题是什么意思,但这里是一个想法:
Dim wb As Object
Dim doc As Object
Dim sURL As String
Set wb = CreateObject(InternetExplorer.Application)
sURL =http://lessthandot.com
wb.Navigate sURL
wb.Busy
DoEvents
Wend
''HTML文档
设置doc = wb.document
''标题
Debug.Print doc.Title
设置wb =没有
Given an url, how can I get the title of the html page in VBA in Excel?
For example suppose I have three urls like :
Now I need to get the title of these html pages in another column. How do I do it?
解决方案
I am not sure what you mean by title, but here is an idea:
Dim wb As Object
Dim doc As Object
Dim sURL As String
Set wb = CreateObject("InternetExplorer.Application")
sURL = "http://lessthandot.com"
wb.Navigate sURL
While wb.Busy
DoEvents
Wend
''HTML Document
Set doc = wb.document
''Title
Debug.Print doc.Title
Set wb = Nothing
这篇关于Excel VBA中的HTML页面标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文