Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Set webdoc = WebBrowser1.Document
Dim Acollection As Object
Set Acollection = webdoc.All.tags("a")
For i = 0 To Acollection.length - 1
if instr(Acollection.Item(i),".SHTML") then
List1.AddItem Acollection.Item(i)
List2.AddItem Acollection.Item(i).innertext
end if
Next
End Sub
这样就可以达到你说的要求了吧?
Set webdoc = WebBrowser1.Document
Dim Acollection As Object
Set Acollection = webdoc.All.tags("a")
For i = 0 To Acollection.length - 1
if instr(Acollection.Item(i),".SHTML") then
List1.AddItem Acollection.Item(i)
List2.AddItem Acollection.Item(i).innertext
end if
Next
End Sub
这样就可以达到你说的要求了吧?