first commit
This commit is contained in:
31
apiscraper/pipelines.py
Normal file
31
apiscraper/pipelines.py
Normal file
@ -0,0 +1,31 @@
|
||||
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
|
||||
Reference in New Issue
Block a user