Class LinkChecker
Given a HTTP URL, tries to load the page from the Internet and checks
if it is still online.
Returns a (boolean, string) tuple saying if the page is online and
including a status reason.
Warning: Also returns false if your Internet connection isn't working
correctly! (This will give a Socket Error)
Method Summary |
|
__init__ (self,
url,
redirectChain)
redirectChain is a list of redirects which were resolved by
resolveRedirect(). |
|
check (self)
Returns True and the server status message if the page is alive. |
|
resolveRedirect (self)
Requests the header from the server. |
__init__(self,
url,
redirectChain=[])
(Constructor)
redirectChain is a list of redirects which were resolved by
resolveRedirect(). This is needed to detect redirect loops.
-
|
check(self)
Returns True and the server status message if the page is alive.
Otherwise returns false
-
|
resolveRedirect(self)
Requests the header from the server. If the page is an HTTP
redirect, returns the redirect target URL as a string. Otherwise
returns None.
-
|