#If Win64 Then
Private Declare PtrSafe
Sub Sleep Lib "kernel32.dll" _
(ByVal dwMilliseconds As LongPtr)
#Else
Private Declare
Sub Sleep Lib "kernel32.dll" _
(ByVal dwMilliseconds As Long)
#End If
Sub Main()
Dim ObjSubAll As Object
Dim objIEDoc As Object
Dim ObjIEApp As Object
Dim ObjAll As Object
Dim strURL As String
On Error GoTo Fin
strURL = Tabelle1.Range("A1")
Set ObjIEApp = CreateObject("InternetExplorer.Application")
With ObjIEApp
.Visible = True ' True
.Navigate2 strURL
Do While .readyState 4: DoEvents: Loop
Do While .Busy: DoEvents: Loop
With .Document
.getElementById("searchfield").Value = Tabelle2.Range("A3").Value 'anpassen
.getElementById("submit_search_btn").Click
Do: Loop Until ObjIEApp.Busy = False
End With
Set objIEDoc = .Document
For Each ObjAll In objIEDoc.All
If ObjAll.classname = "article_details_price2" Then
For Each ObjSubAll In ObjAll.All
Debug.Print ObjSubAll.InnerText
Next ObjSubAll
Exit For
End If
Next ObjAll
End With
Fin:
ObjIEApp.Quit
Set objIEDoc = Nothing
Set ObjIEApp = Nothing
If Err.Number 0 Then MsgBox "Error: " & _
Err.Number & " " & Err.Description
End Sub