class MysqlPipeline(object):
def process_item(self, item, spider):
conn = MySQLdb.connect(host='localhost', user='root',passwd='')
conn.set_character_set("utf8")
conn.select_db('crawl_db');
cursor = conn.cursor()
cursor.execute('set names utf8')
print "insert into etuni values('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s')" % (item['url'],item['username'], item['email'], item['qq'],item['phone'],item['address'],item['sex'], item['birth'], item['postcount'],item['registerDate'])
cursor.execute("insert into etuni values('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s')" % (item['url'],item['username'], item['email'], item['qq'],item['phone'],item['address'],item['sex'], item['birth'], item['postcount'],item['registerDate']))
cursor.close();
return item