CSV Exports - Ordering of columns using scrapy crawl -o output.csv

前端 未结 2 1993
醉话见心
醉话见心 2020-12-18 20:57

Is there a way to specify the order of the columns in a CSV output using the -o parameter?

It seems to follow a random order and does not follow the order in the ite

2条回答
  •  -上瘾入骨i
    2020-12-18 21:35

    There is a relevant field_to_export attribute in CsvItemExporter, but, as far as I understand, there is no way to set it from the command-line. You need to do it through the pipeline, see:

    • How can I use the fields_to_export attribute in BaseItemExporter to order my Scrapy CSV data?

提交回复
热议问题