Hello,
I am willing to check if a specific webpage exist, and for that i am trying the function I got in one of previous posts
and yet, when I run de function to check the following page, it returns TRUE when in fact that page does not exist. why would that be ?
Thanks for helping
I am willing to check if a specific webpage exist, and for that i am trying the function I got in one of previous posts
Code:
Function URLExists(url As String) As Boolean
Dim Request As Object
Dim ff As Integer
Dim rc As Variant
On Error GoTo EndNow
Set Request = CreateObject("WinHttp.WinHttpRequest.5.1")
With Request
.Open "GET", url, False
.send
rc = .statusText
End With
Set Request = Nothing
If rc = "OK" Then URLExists = True
Exit Function
EndNow:
End Function
and yet, when I run de function to check the following page, it returns TRUE when in fact that page does not exist. why would that be ?
Code:
Dim str As String
str = "https://autoline.info/-/sale/mini-excavators/CATERPILLAR-303-5ECR--21030603381891176300"
MsgBox (URLExists(str))
Thanks for helping