《错误记录——SQL上传时错误。错误描述TypeError: not all arguments converted during string formatting

本次错误2021年11月11日出现,出现在爬虫上传本地数据库中。错误无大问题。
首先是问题描述

shangchuan.sjk(title, url_use, time_use, synopsis, category, category_web, label, picture, alternative, picture_seqencing, web_seqencing, time_seqencing, hot_seqencing, soure, soure_icon, soure_url)
File “D:\DAWN\pachong\redian\the day is same\mokuai_shangchuan\shangchuan.py”, line 36, in sjk
cursor.execute(sql, value)
File “E:\python\lib\site-packages\pymysql\cursors.py”, line 146, in execute
query = self.mogrify(query, args)
File “E:\python\lib\site-packages\pymysql\cursors.py”, line 125, in mogrify
query = query % self._escape_args(args, conn)
TypeError: not all arguments converted during string formatting

出现这种错误,只因上传部分**

sql = """INSERT IGNORE  INTO  zixun_bendi (biaoti,lianjie,shijian,jianjie,leibie,leibie_wangzhan,biaoqian,tupian,beixuan,tupian_xuwei,wangzhan_xuwei,shijian_xuwei,redu_xuwei,laiyuan,laiyuantu,laiyuanurl  ) VALUES (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)"""
        cursor.execute(sql, value)
        conn.commit()
        

后面的%s部分少了一个%s。
————————————————————————————(꒦_꒦)

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值