Quick way to validate a URL?

Started by snowsnowsnow, April 04, 2020, 04:48:39 PM

Previous topic - Next topic

snowsnowsnow

I am in the planning states now for a script that will need to "validate" a series of URLs.

By "validate", I mean verity that the URL exists (i.e., that if I loaded it into a browser, it would work).  Obviously, I could just load it into a browser (via keystrokes) and see if it works, but I am hoping for something built-in to WB (e.g., in an extender).

Does that exist?

JTaylor

If you just want a way to verify URLs then this might help (can load from a file even though the web page doesn't mention that)...

         http://www.jtdata.com/jturl.html

doesn't really help if you need the script itself but thought I would throw it out there.  It is free.

Jim

stanl

A series of WinHttp.WinHttpRequest.5.1 requests and record either the status or response text. Could be a simple UDF and several examples of usage on Tech Database. Below is a quick way to check if your version of either WB or Windows supports:


Code (WINBATCH) Select


cURL='urltocheck'
oHTTP = CreateObject("WinHttp.WinHttpRequest.5.1")
oHTTP.Open("GET", cURL, @FALSE)
oHTTP.Send()
oHTTP.WaitForResponse()
response = oHTTP.ResponseText