.from urllib2 import urlopen . try: . urlopen(someURL) . except IOError, errobj: . if hasattr(errobj, 'reason'): print 'server doesnt exist, is down, DNS prob, or we don't have internet connect' . if hasattr(errobj, 'code'): print errobj.code
-- http://mail.python.org/mailman/listinfo/python-list