How do new urls run on the internet explorer that is already open ?
Thank you for your help
Thank you for your help
VBA Code:
Sub getdata()
On Error Resume Next
Dim HTMLDoc As New HTMLDocument
Dim ieBrowser As New InternetExplorer
'variable to specify the row number in excel
Dim lastRow As Integer, rowno As Integer
Dim tag As Object
lastRow = ActiveSheet.Cells(ActiveSheet.Rows.Count, "A").End(xlUp).Row
For i = 3 To lastRow
URLNAME = Cells(i, 1).Value
ieBrowser.Visible = True
ieBrowser.navigate URLNAME
Do
Loop Until ieBrowser.readyState = READYSTATE_COMPLETE
Set HTMLDoc = ieBrowser.document
Application.Wait (Now + TimeValue("0:00:05"))
'Price
ActiveSheet.Cells(rowno, 4) = HTMLDoc.getElementsByClassName("AJyN7v")(0).innerText
'Stock
ActiveSheet.Cells(rowno, 5) = HTMLDoc.getElementsByClassName("_2ZcUKh")(0).innerText
Next
Set ieBrowser = Nothing
Set HTMLDoc = Nothing
End Sub