I have been seeking to validate bulk URL and content in it. And print the value in B2 cell range.
Sub CheckPageData()
Dim cell As Range
Dim IntExp As Object
Set IntExp = CreateObject("InternetExplorer.Application")
IntExp.Visible = True
For Each cell In Range("A2:A10")
'Here A2 is cell Address where we have stored urls which we need to test.
If Left(cell.Value, 4) = "http" Then
' Goto web page
IntExp.Navigate cell.Text
' Below loop will run until page is fully loaded
Do Until IntExp.ReadyState = 4
Loop
' Now use text which you want to search , error text which you want to compare etc.
If InStr(IntExp.Document.body.innerText, _
"Text which you want to search or verify") > 0 Then
cell.Offset(, 1).Value = "Result message which you want to give."
Else
If InStr(IntExp.Document.body.innerText, _
"The page you requested was not found.") > 0 Then
cell.Offset(, 1).Value = "The page you requested was not found."
End If
End If
End If
Next cell
IntExp.Quit
Set IntExp = Nothing
End Sub