06-21-2012, 03:36 PM
Try the below code
Code:
Set alllinkob = Description.Create()
alllinkob("micclass").value ="Link"
Set objAlllinkObj = Browser("Google").Page("Google").ChildObjects(alllinkob)
For a =0 to objAlllinkObj.count-1
url = objAlllinkObj(a).getroproperty("url")
call geturlstatus(url )
Next
Public Function geturlstatus(url )
On Error Resume Next
Call ClearBrowserCache()
Set webService = nothing
Set webService= CreateObject("Microsoft.XMLHTTP") ' Create an xmlhttp object
webService.open "GET", url, False ' Opens the connection to the remote server
webService.Send
pagestatus = webService.status
If pagestatus < 200 or pagestatus >399 Then
print "In valid request" & pagestatus &"" & url
geturlstatus = 0
else
geturlstatus = 1
print "valid request"& pagestatus &"" & url
End If
Set webService = nothing
err.clear
End Function