title: Scrapy save URLs titles in text file
body: <p>Hi I have following Scrapy code and I want to save all titles of URLs provided in one file but it saves only title of last("url3").</p>
  
  <pre><code>    from scrapy.spider import BaseSpider
      from scrapy.selector import Selector
      from scrapy.http import HtmlResponse
      from kirt.items import KirtItem 
  
      class KirtSpider(BaseSpider):
  
          name = "spider-name"
  
          allowed_domains = ["url1","url2","url3"]
  
          start_urls = ["url1","url2","url3"]
  
  
      def parse(self,response):
  
          sel = Selector(response)
          title = str(sel.xpath('//title/text()').extract())
  
          with open('alltitles.txt','w') as f:
              f.seek(0)
              f.write(title)
  </code></pre>