Option
Explicit
Sub
extraktor()
With
CreateObject(
"InternetExplorer.Application"
)
.Visible =
False
Debug.Print
Debug.Print Time$,
"rufe Daten ab... "
;
Dim
vnt
As
Variant
Dim
t
As
Single
t = Timer
Do
Until
Not
.Busy
And
.readyState = 4
If
Timer < t + 10
Then
DoEvents
Else
.stop
vnt = CVErr(XlCVError.xlErrUnknown)
Exit
Do
End
If
Loop
If
IsError(vnt)
Then
Debug.Print
"Timeout!"
.Quit
Exit
Sub
Else
Debug.Print
"Erfolg!"
End
If
Debug.Print Time$,
"suche Information... "
;
For
Each
vnt
In
.document.getElementsByTagName(
"span"
)
If
0 = StrComp(vnt.outerText,
"Umsatzklasse:"
, vbTextCompare)
Then
vnt = Trim$(vnt.NextSibling.data)
Exit
For
End
If
Next
If
Not
IsEmpty(vnt)
Then
Debug.Print
"Erfolg!"
Debug.Print Time$, Spc(2);
"-> '"
; vnt;
"'"
Sheets(
"Dummy"
).Range(
"A1"
).Value = vnt
Else
Debug.Print
"Fehlschlag!"
End
If
.Quit
End
With
End
Sub