#coding:utf-8 ''''' Created on 2014-7-24 @author: Administrator ''' import urllib2 try: url = "http://www.baidu.com" f = urllib2.urlopen(url, timeout=0) #timeout设置超时的时间 result = f.read() # print len(result) print result except Exception,e: print 'a',str(e)