32 lines
758 B
Python
32 lines
758 B
Python
from itemadapter import ItemAdapter
|
|
#import sqlite3
|
|
|
|
|
|
class ApiscraperPipeline:
|
|
#def __init__(self):
|
|
# self.con = sqlite3.connect('api.db')
|
|
# self.cur = self.con.cursor()
|
|
#
|
|
# self.cur.execute("""
|
|
# CREATE TABLE IF NOT EXISTS api(
|
|
# title TEXT,
|
|
# method TEXT,
|
|
# endpoint TEXT,
|
|
# inclusions TEXT
|
|
# )
|
|
# """)
|
|
|
|
def process_item(self, item, spider):
|
|
# self.cur.execute("""
|
|
# INSERT INTO api (title, method, endpoint, inclusions) VALUES (?,?,?,?)
|
|
# """,
|
|
# (
|
|
# item['title'],
|
|
# item['method'],
|
|
# item['endpoint'],
|
|
# item['inclusions'],
|
|
# ))
|
|
|
|
# self.con.commit()
|
|
return item
|