def parse(self, response):
        """Main handler for all downloaded responses"""
        request = response.request
        if (request and request.method == 'POST' and
                urlparse(request.url).hostname == self.SPLASH_HOST):
            url = json.loads(request.body.decode(request.encoding)).get('url')
            if url:
                response._url = url
        _type = content_type(response)
        if (isinstance(response, XmlResponse) or
                response.url.endswith(('.xml', '.xml.gz')) or
                'xml' in _type.subtype):
            sitemap_body = self._get_sitemap_body(response)
            if sitemap_body:
                response._set_body(self._get_sitemap_body(response))
            return self.handle_xml(response)
        if isinstance(response, html_responses):
            return self.handle_html(response)
        self.logger.debug(
            "Ignoring page with content-type=%r: %s" % (
                response.headers.get('Content-Type', ''), response.url)
        )
        return []
Main handler for all downloaded responses
slybot/slybot/spider.py