The second way is :
On Error Resume Next
'open the webpage
Set objIE = wscript.CreateObject("InternetExplorer.Application")
objIE.visible = 0
objIE.ToolBar = 0
objIE.statusbar=0
objIE.Navigate "https://www.muslimpro.com/Prayer-times-Mecca-Saudi-Arabia-104515"
While objIE.Busy Or objIE.ReadyState <> 4 : WScript.Sleep 100 : Wend
'check webpage
webTXT=objIE.Document.Body.innerHTML
myArray=array("The page cannot be displayed","Internet Explorer cannot display the webpage","not connected to a network","notConnectedTasks","errorText","errorCodeAlign")
For Each item In myArray
If InStr(1,webTXT,item,1)>0 Then
myMsg="Webpage didn't loaded .Try again."
Exit For
Else
myMsg="Webpage loaded successfully."
End If
Next
MsgBox myMsg
objIE.Quit
WScript.Quit
I used in this way array myArray
of error page text display by Internet explorer of xp and windows 7 and 10 and some of id elements inside this error page to show how can you add anything inside the html page to this array ( like tags of id
or class
names or just text) to check if exist or not.so you know the page load or not.
You can replace myArray
values with array of your web page text or Id
or Class
and check if exist in body of web page IE download or not so you have idea you success load page or not.