0

I am building an Extension for Python Scrapy to get Crawler related details like its start time, end time, crawler status(opened, closed or active).. Now I need to store current timestamp in my MySql Database table. Can anybody help me with this? I need a code to connect MySql Database from Scrapy code and do database related Queries like Insert, Select , etc.. Thanks..

4

1 回答 1

0

您需要在项目中添加一个项目管道,按照此处所述添加方法 process_item:http: //doc.scrapy.org/en/0.18/topics/item-pipeline.html#process_item

在该方法中,您必须按照此处所述将数据插入 MySQL:http: //dev.mysql.com/doc/connector-python/en/index.html

于 2013-10-14T13:25:34.987 回答