The code you posted does not work, as for me:
TypeError: __init__() takes exactly 2 arguments (1 given)
This is because the __init__ method expects an argument to table_name that is not passed. You need to implement the from_crawler class from_crawler in the pipeline object, for example:
@classmethod def from_crawler(cls, crawler): return cls(table_name=crawler.spider.name)
This will create a pipeline object using the name spider as the name of the table, you can, of course, use whatever name you want.
In addition, the line self.table = db[table_name].table should be replaced by self.table = db[table_name] ( https://dataset.readthedocs.io/en/latest/quickstart.html#storing-data )
After that, the data is saved: 
source share