Jump to content

check if url is active?


 Share

Recommended Posts

Hi again guys, am here with a noob question e.e. 
How can i check if i get an active URL? because sometimes my internet is not working propperly and then i get the error saying, "YOU ARE NOT CONNECTED TO INTERNET" in internet explorer. and i want to check if there a way to test if the webpage is active. 
I was triying with _inetgetsource but dont seems to work.

 

$findtl = _GetIP
$check1 = _INetGetSource("https://www.happypanda.com")
If StringInStr($check1,$findtl) Then
   ConsoleWrite ("YES")
EndIf

 

Thanks in advanced.

Link to comment
Share on other sites

Ping does not do the job anyway...

Msgbox(0,"", _UrlAlive("autoitscript.com/forum/topic/179385-check-if-url-is-active/"))

Func _UrlAlive($url)
    Return (Ping($url) = 0) ? 0 : 1
EndFunc

Well it does for the domain, but nothing else.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Right... I wrote this because in post #1 the OP seemingly wanted to check a domain, and ping is faster

Msgbox(0,"", _UrlAlive("happypanda.com"))

Func _UrlAlive($url)
    Return (Ping($url) = 0) ? 0 : 1
EndFunc

BTW strangely this code returns false  :mellow:

Msgbox(0,"", _UrlAlive("https://www.happypanda.com"))

Func _UrlAlive($url)
    Return Not (InetRead($url, 1) = "")
EndFunc

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...