|
Dim WithEvents objDocument As HTMLDocument
Dim objHtml As New HTMLDocument
Sub ff()
Set objDocument = objHtml.createDocumentFromUrl("http://www.okooo.com/League/LeagueInfoIndex.php?TurnID=" & Cells(2, "i").Text & "&GroupID=2693", vbNullString)
End Sub
Private Sub objDocument_onreadystatechange()
Dim a As Object, i&, j&
Columns("a:h") = ""
If objDocument.readyState = "complete" Then
Set a = objDocument.getElementsByTagName("table")(2).Rows
For i = 1 To a.Length - 1
For j = 0 To a(i).Cells.Length - 1
Cells(i + 2, j + 1) = a(i).Cells(j).innerText
Next
Next
Range("a1") = objDocument.URL
Set objDocument = Nothing
Set objHtml = Nothing
End If
End Sub
这段代码只能获取超链接的文本。怎么才能获取超链接。谢谢!
|
|