self.cursor.execute("insert into %s ( NameTeam, Score, Data) values (%s,%s,%s); ",
psycopg2.errors.SyntaxError: ОШИБКА: ошибка синтаксиса
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
from .spiders import sql
import psycopg2
from .items import MarafonItem
def db(self, item):
b = 0;
a = 0;
table_name = len(item['Category_label'])
total_name = len(item['Names'])
while b <= table_name:
while a <= total_name:
self.cursor.execute("insert into %s ( NameTeam, Score, Data) values (%s,%s,%s); ",
(item['Category_label'][b],
item['Names'][a],
item['Score'][a],
item['Date'][a]
))
self.connect.commit()
a += 1;
b += 1;