Skip to content

Instantly share code, notes, and snippets.

@inetkiller
Created June 27, 2013 08:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inetkiller/5875024 to your computer and use it in GitHub Desktop.
Save inetkiller/5875024 to your computer and use it in GitHub Desktop.
这段代码哪里有问题了
def GetPage(self,url):
try:
fp = urllib2.urlopen(url)
result = fp.read()
except Exception, e:
self.logger.error(
'url %s is unreachable. Exception %s %s' %
(url, e.__class__.__name__, e))
result=None
fp.close()
return result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment