Check URL --> Simply?

Tom Bryan tbryan at
Wed Aug 15 02:51:28 CEST 2001

JS wrote:

> Is there anything that works like this?
> checkLink(url):
>      # If url exists, return 1
>      # If url does not exist, return 0
> All I want to do is check the external links in a html file and log if
> they exist or not. Unfortunately, I am not skilled enough to write
> something myself.

You may also find it interesting to look in the Tools directory of your 
Python (source) installation.

$ cat /usr/local/Python-2.1.1/Tools/webchecker/README
This is a simple web tree checker, useful to find bad links in a web
tree.  It currently checks links pointing within the same subweb for
validity.  The main program is "".  See its doc string
(or invoke it with the option "-?") for more defails.
- Jan 1997.  First release.  The module was written by
Skip Montanaro; the rest is original work by Guido van Rossum.
- May 1999.  Sam Bayer contributed a new version,, which
supports checking internal links (#spam fragments in URLs) and some
other options.
- Nov 1999.  Sam Bayer contributed patches to reintegrate
into, and corresponding mods to and

More information about the Python-list mailing list