金在中为了你mp3下载:[vb6.0]Webbrowser1.Document.All.item(i).href

来源:百度文库 编辑:高校问答 时间:2024/04/29 06:19:24
[vb6.0][vb6.0]Webbrowser1.Document.All.item(i).href看到有人这样写,可我运行时出错,到底它有没有href这个成员啊?

<a href="http://www.21cn.com"> 去21cn.com </a>
请问如果:
Webbrowser1.Document.All.item(i)="http://www.21cn.com"
Webbrowser1.Document.All.item(i).tagname="a"
那么
Webbrowser1.Document.All.item(i).______="去21cn.com" ???

如果想要得到它的值,可以用 innerText 属性。
但要注意,不是每个元素都有 href 的,你需要判断一下它的 tagname以后再去决定用它的什么属性,如:
If Webbrowser1.Document.All.item(i).tagname="A" Then
msgbox Webbrowser1.Document.All.item(i).href & vbCrlf & Webbrowser1.Document.All.item(i).innerText
End If