账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    python运行没有错误,但是mysql数据库没有内容
    34
    0

    pipelines中的一段代码,报错是从这段代码之后开始的

    def process_item(self,item,spider):
            insert_sql="""
                insert into article(title,create_date,tags,praise_num,post_url)
                VALUES (%s,%s,%s,%s,%s)
            """
            self.cursor.execute(insert_sql,(item["title"],item["create_date"],item["tags"],item["praise_num"],item["post_url"]))
            self.conn.commit()

    错误提示:

    2018-02-13 15:34:28 [scrapy.core.scraper] DEBUG: Scraped from <200 http://blog.jobbole.com/113622/>;
    None
    [Failure instance: Traceback: <class '_mysql_exceptions.OperationalError'>: (1241, 'Operand should contain 1 column(s)')
    

    用其他文件输出是正确的,程序运行也没有中断,但是数据库里就是啥都没有
    请各位大佬指点

    1
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • 更俗 普通会员 1楼
      502 Bad Gateway

      502 Bad Gateway


      nginx
    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部