def from_body(self, body):
        chunk = body[:5000]
        chunk = to_bytes(chunk)
        if not binary_is_text(chunk):
            return self.from_mimetype('application/octet-stream')
        elif b"<html>" in chunk.lower():
            return self.from_mimetype('text/html')
        elif b"<?xml" in chunk.lower():
            return self.from_mimetype('text/xml')
        else:
            return self.from_mimetype('text')
Try to guess the appropriate response based on the body content.
dataset/ETHPy150Open scrapy/scrapy/scrapy/responsetypes.py/ResponseTypes.from_body