Hi:
The following macro will search for strings on the column B of the attached workbook in Google and will display the search results in separate explorer tabs for each search string.
Now I want to extract the URLs for the first 5 search results to a spreadsheet from each tab in the explorer. I am sure there is a way to achieve this, but not quite sure how. I am attaching a sample file with the above macro.
Thanks
Nebu
The following macro will search for strings on the column B of the attached workbook in Google and will display the search results in separate explorer tabs for each search string.
Code:
Sub test()
Application.ScreenUpdating = False
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
For i& = 2 To Sheet1.Cells(Rows.Count, 2).End(xlUp).Row
While Sheet1.Range("B" & i) <> vbNullString
IE.Navigate "https://www.google.co.in/search?q=" & Sheet1.Range("B" & i), CLng(2048)
While IE.Busy
DoEvents
Wend
i = i + 1
Wend
Next
Set IE = Nothing
Application.ScreenUpdating = True
End Sub
Now I want to extract the URLs for the first 5 search results to a spreadsheet from each tab in the explorer. I am sure there is a way to achieve this, but not quite sure how. I am attaching a sample file with the above macro.
Thanks
Nebu