0

I am using scrapy to scrape data from a website .And I am getting data in this format. e.g { 'Date': '03/06/2020', 'LTV': '90', } { 'Date': '03/06/2020', 'LTV': '80', }

{ 'Date': '03/06/2020', 'LTV': '70', } ...I want to change this Sequence. I want LTV ->70 , 80, 90, in this sequence. First come LTV 70 array then 80 and So on.
Note : I am using Scrapy framework.

1 Answers1

0

Scrapy outputs item in parsing order by design. You cannot rely on them being in a specific order.

If you want to sort output items in a specific way, you should do one of the following:

  • Use a custom script after running Scrapy to sort the items in the output file.

  • Write a custom item exporter that sorts the items in the output file from its finish_exporting() method

Gallaecio
  • 3,620
  • 2
  • 25
  • 64