import pycurl,time,urllib2 contents = "" def callback(buf): global contents contents += buf timeNow = time.time() req = urllib2.Request('http://www.python.org/') response = urllib2.urlopen(req) the_page = response.read() print "urllib: " + time.time() - timeNow timeNow = time.time() c = pycurl.Curl() c.setopt(c.URL, 'http://www.python.org/') c.setopt(c.WRITEFUNCTION, callback) c.perform() c.close() print "pycurl: " + time.time() - timeNow