Hallo,
ich habe das Problem mittlerweile anders gelöst. Ich verwende ein MSHTML-Objekt, um auf die einzelnen Tags zuzugreifen. Nur brauche ich jetzt eine Möglichkeit, über die ich mir ChildNodes holen kann. Mein Code sieht z.Z. folgendermaßen aus:
Dim objIE As Object
Dim varTables, varTable
Dim varRows, varRow
Dim varCells, varCell
Dim lngRow As Long, lngColumn As Long
Dim strBuffer As String
Set objIE = CreateObject("InternetExplorer.Application")
With objIE
.AddressBar = False
.StatusBar = False
.MenuBar = False
.Toolbar = 0
.Visible = True
.Navigate "seite\_mit\_tabellen"
End With
While objIE.Busy
Wend
While objIE.document.ReadyState "complete"
Wend
Set varTables = objIE.document.all.tags("TABLE")
For Each varTable In varTables
Debug.Print varTable.Item(1)
'Use the innerText to see if this is the table we want.
If varTable.innerText Like "FirmaPLZBrancheRegion" Then
Set varRows = varTable.Rows
lngRow = 2 'This will be the first output row
For Each varRow In varRows
Set varCells = varRow.Cells
lngColumn = 1 'This will be the output column
For Each varCell In varCells
ActiveSheet.Cells(lngRow, lngColumn) = varCell.innerText
lngColumn = lngColumn + 1
Next varCell
lngRow = lngRow + 1
Next varRow
Debug.Print varTable.innerText
End If
Next varTable
Cleanup:
Set varCell = Nothing: Set varCells = Nothing
Set varRow = Nothing: Set varRows = Nothing
Set varTable = Nothing: Set varTables = Nothing
objIE.Quit
Set objIE = Nothing
Ich bekomme es aber irgendwie nicht hin die Subtags der einzelnen Tabellen über „varTable.Item(1)“ zu bekommen. Es muss doch einen Weg geben, wie ich die ChildNodes als Objekte herausbekommen kann, oder nicht?
[MOD] - Pre Tags eingefügt