#import urllib, sys #pages = ['http://www.python.org', 'http://xxx'] #for i in pages: # try: # u = urllib.urlopen(i) # print u.geturl() # except Exception, e: # print >> sys.stderr, '%s: %s' % (e.__class__.__name__, e) will print an error if a page fails opening, rest opens fine