我想知道是否有人可以告诉我如何从Excel - VB中的以下字符串推断'http://www.nbc.com/xyz'和'我喜欢这个节目'.
谢谢
<a href="http://www.nbc.com/xyz" >I love this show</a><IMG border=0 width=1 height=1 src="http://ad.linksynergy.com/fs-bin/show?id=Loe5O5QVFig&bids=261463.100016851&type=3&subid=0" >
Run Code Online (Sandbox Code Playgroud)
Sub Tester()
'### add a reference to "Microsoft HTML Object Library" ###
Dim odoc As New MSHTML.HTMLDocument
Dim el As Object
Dim txt As String
txt = "<a href=""http://www.nbc.com/xyz"" >I love this show</a>" & _
"<IMG border=0 width=1 height=1 " & _
"src=""http://ad.linksynergy.com/fs-bin/show?" & _
"id=Loe5O5QVFig&bids=261463.100016851&type=3&subid=0"" >"
odoc.body.innerHTML = txt
Set el = odoc.getElementsByTagName("a")(0)
Debug.Print el.innerText
Debug.Print el.href
End Sub
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
248 次 |
| 最近记录: |