title: Python Scrapy how to save data in different files
body: <p>I want to save each quote from <a href="http://quotes.toscrape.com/" rel="nofollow noreferrer">http://quotes.toscrape.com/</a> saved into a csv file (2 field : author, quote). One other necessity is to save these quotes in different files seperated by the page they reside. ie : (page1.csv, page2.csv ...). I have tried to achieve this by declaring feed exports in <code>custom_settings</code> attribute in my spider as shown below. This, however, doesn't even produce a file called <code>page-1.csv</code>. I am a total beginner using scrapy, please try to explain assuming I know little to nothing.</p>
  <pre><code>import scrapy
  import urllib
  
  class spidey(scrapy.Spider):
      name = &quot;idk&quot;
      start_urls = [
          &quot;http://quotes.toscrape.com/&quot;
      ]
  
      custom_settings = {
          'FEEDS' : {
              'file://page-1.csv' : { #edit: uri needs to be absolute path
                  'format' : 'csv',
                  'store_empty' : True
              }
          },
          'FEED_EXPORT_ENCODING' : 'utf-8',
          'FEED_EXPORT_FIELDS' : ['author', 'quote']
      }
      
  
      def parse(self, response):
          for qts in response.xpath(&quot;//*[@class=\&quot;quote\&quot;]&quot;):
              author = qts.xpath(&quot;./span[2]/small/text()&quot;).get()
              quote = qts.xpath(&quot;./*[@class=\&quot;text\&quot;]/text()&quot;).get()
              yield {
                  'author' : author,
                  'quote' : quote
                  }
  
          next_pg = response.xpath('//li[@class=&quot;next&quot;]/a/@href').get()      
          if next_pg is not None:
              next_pg = urllib.parse.urljoin(self.start_urls[0], next_pg)
              yield scrapy.Request(next_pg, self.parse)
  </code></pre>
  <p>How I ran the crawler: <code>scrapy crawl idk</code>
  As an added question, I need my files to be overwritten as opposed to being appended like when specifying <code>-o</code> flag. Is it possible to do it without having to manually check/delete preexisting files from spider?</p>