Check URL --> Simply?

David Eppstein eppstein at ics.uci.edu
Thu Aug 16 13:06:40 EDT 2001


In article <mailman.997979553.20974.python-list at python.org>,
 "Dr. David Mertz" <mertz at gnosis.cx> wrote:

>     % python check_url.py
>     http://msnbc.com/nonsense (200, 'OK')
>     http://msnbc.com/ (302, 'Object moved')
>     http://w3c.org/ (301, 'Moved Permanently')
>     http://w3c.org/nonsense (301, 'Moved Permanently')
>     http://w3c.org/Consortium/ (301, 'Moved Permanently')
>     http://ibm.com/ (200, 'OK')
>     http://ibm.com/nonsense (404, 'Not Found')
> 
> I tried a few sites to get these examples... but not all *that* many.
> All the sites that end in 'nonsense' LOOK, to my human eyes, like broken
> links... and all the others look like content (well, except msnbc.com,
> which refuses to load--I think because I won't give it a cookie--and
> wouldn't actually be other than nonsense if it would load :-)).

I don't know about the msnbc examples, but the 301 from w3c is telling you 
something useful -- it prefers to be called www.w3.org.
-- 
David Eppstein       UC Irvine Dept. of Information & Computer Science
eppstein at ics.uci.edu http://www.ics.uci.edu/~eppstein/



More information about the Python-list mailing list