VBA GET request returning 404 when curl returns 200
Why not use .FollowHyperlink
to check if the URL exists?
See this example.
Sub Sample() Dim url As String url = "http://www.stopwaste.org/home/index.asp#" Debug.Print url, CheckIfURLExists(url) url = "http://www.Google.com" Debug.Print url, CheckIfURLExists(url) url = "http://www.Goo00000gle.com" Debug.Print url, CheckIfURLExists(url)End SubFunction CheckIfURLExists(ByVal sLink As String) As Boolean On Error Resume Next ThisWorkbook.FollowHyperlink (sLink) CheckIfURLExists = Err.Number = 0End Function
Screenshot: