Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Check all links of a website
#2
Not Solved
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
Reply


Messages In This Thread
Check all links of a website - by sia sharma - 06-21-2012, 03:27 PM
RE: Check all links of a website - by ssvali - 06-21-2012, 03:36 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Check specific links of a webpage rocky9 1 2,555 06-11-2015, 06:23 PM
Last Post: venkatesh9032
  Get value from table out of a website Flooole 9 5,238 10-10-2013, 02:07 PM
Last Post: Flooole
  Menu is not displayed on the website to run QTP 11 jacosta 1 2,364 10-02-2012, 08:47 PM
Last Post: freeboynil
  Error opening the sample Mercury tours website akilashanmugam 0 2,679 06-15-2012, 04:43 PM
Last Post: akilashanmugam
Sad Mecury Tours Website suspended uherch 1 3,177 05-10-2012, 08:41 PM
Last Post: defcon3

Forum Jump:


Users browsing this thread: 1 Guest(s)