我正在学习那篇无聊的教程。为了测试这个过程,我用这些文件创建了一个新项目:
See my post in Scrapy group for links to scripts, I cannot post more than 1 link here.
spider运行良好,在title标签之间刮取文本并将其放入FirmItem中
[whitecase.com] INFO: Passed FirmItem(title=[u'White & Case LLP - Lawyers - Rachel B. Wagner '])
但我被困在了流水线上。我想把这个FirmItem添加到一个csv文件中,这样我就可以把它添加到数据库中。在
我是python的新手,我在不断学习。如果有人能告诉我如何制作管道.py将收集到的数据放入项目.csv. 在
谢谢。在
将内置的CSV feed export(在v0.10中可用)与CsvItemExporter一起使用。在
我想他们在Scrapy Tutorial中提到了你的具体问题。在
它建议,就像其他人使用CSV模块一样。将以下内容放入
^{pr2}$pipelines.py
文件中。在调整以适应项目的具体情况。在
Python有一个module for reading/writing CSV files,这比自己编写输出更安全(并且正确地引用/转义…)
相关问题 更多 >
编程相关推荐