Created
June 27, 2013 08:53
-
-
Save inetkiller/5875024 to your computer and use it in GitHub Desktop.
这段代码哪里有问题了
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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