title: Scrapy taking old text from webpage
body: <p>I have created a spider which checks for a particular movie booking site whether the film is opened for booking. It checks of every 10 seconds. But the problem I'm facing is, even when the booking is opened in the website, my code doesn't get the updated website, instead using the old <strong>scraped</strong> data.</p>
  <p>for example:</p>
  <p>I <strong>scraped</strong> the site and film 'A' is not opened for booking at 8AM. Booking for film 'A' is opened at 12PM, but the spider shows it's not opened for booking. To be noted, i'm using a indefinite while loop so I started running the program from 8AM and never stopped.</p>
  <p>Code:</p>
  <pre><code># -*- coding: utf-8 -*-
  import scrapy
  from scrapy.http import Request
  import threading
  import time
  import datetime
  import winsound
  
  class NewFilmSpiderSpider(scrapy.Spider):
      name = 'new_film_spider'
      allowed_domains = ['www.spicinemas.in']
      start_urls = ['https://www.spicinemas.in/coimbatore/now-showing']
  
      def parse(self, response):
          t = threading.Thread(self.getDetails(response))
          t.start()
  
      def getDetails(self, response):
          while True:
              records = response.xpath('//section[@class=&quot;main-section&quot;]/section[2]/section[@class=&quot;movie__listing now-showing&quot;]/ul/li/div/dl/dt/a/text()').extract()
              if 'NGK' in str(records):
                  try:
                      print(&quot;Booking Opened&quot;,datetime.datetime.now())
                      winsound.PlaySound('alert.wav', winsound.SND_FILENAME)
                  except Exception:
                      print (&quot;Error: unable to play sound&quot;)
              else:
                  print(&quot;Booking Not Opened&quot;,datetime.datetime.now())
              time.sleep(10)
  </code></pre>
  <p>If you run the code now, it says booking opened. but I need to get the webpage <strong>scraped</strong> at every while loop. How can I do that?</p>
  <p>Update #1:</p>
  <p>I'm getting these trace when running using the solution given below</p>
  <pre><code>File &quot;C:\Users\ranji\Documents\Spiders\SpiCinemasSpider\spicinemas_spider\spiders\new_film_spider.py&quot;, line 34, in &lt;module&gt;
      main()
    File &quot;C:\Users\ranji\Documents\Spiders\SpiCinemasSpider\spicinemas_spider\spiders\new_film_spider.py&quot;, line 30, in main
      process.start()
    File &quot;C:\Users\ranji\AppData\Local\Programs\Python\Python37-32\lib\site-packages\scrapy\crawler.py&quot;, line 293, in start
      reactor.run(installSignalHandlers=False)  # blocking call
    File &quot;C:\Users\ranji\AppData\Local\Programs\Python\Python37-32\lib\site-packages\twisted\internet\base.py&quot;, line 1271, in run
      self.startRunning(installSignalHandlers=installSignalHandlers)
    File &quot;C:\Users\ranji\AppData\Local\Programs\Python\Python37-32\lib\site-packages\twisted\internet\base.py&quot;, line 1251, in startRunning
      ReactorBase.startRunning(self)
    File &quot;C:\Users\ranji\AppData\Local\Programs\Python\Python37-32\lib\site-packages\twisted\internet\base.py&quot;, line 754, in startRunning
      raise error.ReactorNotRestartable()
  twisted.internet.error.ReactorNotRestartable
  </code></pre>