1
sutra 2018-01-12 16:00:17 +08:00
没有异常信息吗?
|
2
frostming 2018-01-12 17:08:48 +08:00
sql = """INSERT INTO test(title,source_time, source, content_body, pageurl,pic)VALUES (title,time,source,content_content,content_url,pic)"""
你解析的信息呢? |
3
qingfengxm 2018-01-12 18:02:57 +08:00
source 是 sql 关键字吧
|
4
GenHong 2018-01-12 18:46:34 +08:00
sql = """INSERT INTO test(title,source_time, source, content_body, pageurl,pic)VALUES (%s,%s,%s,%s,%s,%s)"""
# 执行 sql 语句 cursor.execute(sql, (title,time,source,content_content,content_url,pic)) |
5
JerryCha 2018-01-12 20:43:56 +08:00
except:
# 如果发生错误则回滚 db.rollback() except Exception as e: print(e) db.rollback() 我猜楼主直接从 runoob 学的 |