title: How to do a task after scraping all the pages of website using Scrapy-Python
body: <p>I want to perform some task after my <strong>scraper</strong> <strong>scrapes</strong> all the anchors of a home page of a website. But the print statement is executed before processing the parse_details of all pages.</p>
  <p>Any HELP would be appreciated. Thanks in advance</p>
  <pre><code>    
      def parse_site(self,response):
          next_links = response.css('a::attr(href)').getall()
         
          for next_link in next_links:
                yield response.follow(next_link,callback=self.parse_detail)
          print(&quot;Task after complettion of all pages&quot;)
         
       def parse_detail(self,response):
          
          print(&quot;@@@@@@@@@@@@@@@@@GETTING HERE################&quot;)
          all_content = response.xpath('//body').extract()
          print(&quot;###############&quot;)
          print(response.url)
  </code></pre>