Created
September 23, 2014 01:37
-
-
Save newbiethetest/ee8375fed2ae529e1e67 to your computer and use it in GitHub Desktop.
This file contains 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
class MysqlStordPipeline(object): | |
def __int__(self): | |
self.connect=MySQLdb.connect('localhost','root','123654','niaoyundb',charset='utf8', use_unicode=True) | |
self.cursors=self.connect.cursor() | |
def process_item(self,item,spider): | |
try: | |
self.cursors.execute("select version()") | |
except MySQLdb.Error,e: | |
print "Error %d: %s" % (e.args[0], e.args[1]) | |
return item |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment