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

前端 未结 2 1995
醉话见心
醉话见心 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条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-18 21:36

    You can solve it from adding a line in settings.py

    FEED_EXPORT_FIELDS = ['field1', 'field2', 'field3']
    

提交回复
热议问题