1 2 3 4 5 6 7 8 | from BeautifulSoup import BeautifulSoup
class Prettify(object):
def process_response(self, request, response):
if response.has_header('Content-Type') and response['Content-Type'].startswith('text/html'):
response.content = BeautifulSoup(response.content).prettify()
return response
|
More like this
- Prettify HTML body contents in HTTP response by n1k0 1 year, 5 months ago
- Prettify HTML5 middleware by runejuhl 10 months, 2 weeks ago
- prettify html by marchino 5 years, 1 month ago
- DebugFooter middleware by simon 4 years ago
- debug info middleware by mzitnik 3 years, 9 months ago
Comments