I want to search a list of EANs on google using chrome/MS edge. VBA Macro should search each EAN on google and save the first link to the excel file. Also if possible, if it returns the search link, I want to save the first searched image of the product to a local drive.
The code should be written as VBA / Excel code. I am using below code, it opens the chrome browser and even searches the records, but I can't fetch the link of first search result and the image.
chpth="This variable will have full path of browser.exe"
cnt = WorksheetFunction.CountA(Range("a:a"))
For i = 2 To cnt
ea = Range("A" & i).Value
surl = "https://www.google.com/search?q=" & ea
Shell (chpth & " -url https://www.google.com/search?q=" & ea)
next
I even tried the code on below link.. but it shows Object Required Error at the debug.print line How to get the first search result link of a google search using VBA?