Hi there, welcome to the forum.
Give this a try, should help:
Public Declare Sub Sleep Lib "kernel32" (ByVal Milliseconds As Long)
Sub GetVal()
Dim ie As Object
Dim url As String
Dim Doc As HTMLDocument
url = "https://www.sainsburys.co.uk/webapp/wcs/stores/servlet/gb/groceries"
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = True
.navigate url
Do While ie.readyState <> 4: Sleep (200): Loop
Sleep (2000)
ie.document.getElementById("search").Value = "Cheese"
ie.document.forms(0).submit
Do While ie.readyState <> 4: Sleep (200): Loop
Sleep (2000)
End With
Set Doc = ie.document
Set myPoints = Doc.getElementsByClassName("pricePerUnit")
For x = 1 To myPoints.Length
Sheet1.Range("A" & x).Value = myPoints(x - 1).innerText
Next x
ie.Quit
Set ie = Nothing
End Sub
Hope this helps