python - Scrapy pipeline to mysql Error 1241 -
I am new to screary, python and mysql so please forgive me if it is easy I believe that Has a syntax problem, but I do not have enough information yet to fix it. I need to "Error 1241: Operap should contain 1 column" When I try to scrape through this pipeline and nothing is given to the database.
def __init __ (self): self.conn = MySQLdb.connect (user = 'user', passwd = 'pass', db = 'db', host = 'host', charset = 'utf8', use_unicode = true) self.cursor = self.conn.cursor () ("% 1", (item ['1'], item ['2'], object ['3'], Item ['4'])) self.conn.commit () except MySQLdb.Error, e: print "error% d:% S"% (e.args [0], e.args [1]) return item
Try it out:
self.cursor INSERT VALUES ('% S,% s,% s,% s) ", (item [' 1 '] on execute (" "" table' (`1`,` 2`, `3`,` 4`) , Item ['2'], item ['3'], item ['4']))
Comments
Post a Comment