user3168180
user3168180

Reputation: 65

Setting/Configuring the output file after running scrapy spider

I'm able to run a scrapy spider from a script. But I want to store the output in a specific file(say output.json) in json format. I did a lot of research & also tried to override FEED_URI & FEED_FORMAT from settings. I also tried to use JsonItemExporter function but all in vain. Any help will be appreciated. Thanks!

Upvotes: 1

Views: 559

Answers (2)

Abhishek
Abhishek

Reputation: 3068

Use either of the following commands

scrapy crawl yourspidername --set FEED_URI=output.json --set FEED_FORMAT=json

scrapy crawl yourspidername -o output.json -t json

Upvotes: 0

loki
loki

Reputation: 387

I think you should use scrapy crawl yourspider -o output.json -t json

where -o output filename and -t output format.

Upvotes: 2

Related Questions