может кто-нибудь помочь мне, весь мой код работает, но когда я открываю файл mytask.db, ничего не вставляется / не обновляется в файле базы данных, скажите, пожалуйста, причину, по которой база данных не обновляется, я открываю базу данных в https://sqliteonline.com/, помогите пожалуйста
import sqlite3
class TaskPipeline(object):
def __init__(self):
self.create_connection()
self.create_table()
def create_connection(self):
self.conn = sqlite3.connect("mytask.db")
self.curr = self.conn.cursor()
def create_table(self):
self.curr.execute("""DROP TABLE IF EXISTS cr_tb""")
self.curr.execute("""create table tk_tb(
title text,
tag text
)""")
def process_item(self, item, spider):
self.store_db(item)
return item
def store_db(self, item):
self.curr.execute("""insert into tk_tb values (?,?)""", (
item['title'][0],
item['tag'][0]
))
self.conn.commit()