Skip to content

Instantly share code, notes, and snippets.

View aaloy's full-sized avatar

Antoni Aloy aaloy

View GitHub Profile
import cssutils
from xml.sax import saxutils
from lxml.html import tostring, fromstring, clean
from lxml import etree
import logging
class Cleaner(clean.Cleaner):
def clean_html(self, html):
if not isinstance(html, unicode):