Arcgis Online Free

But even better than cleaner.safe_attrs_only = False is to use Cleaner(safe_attrs=lxml.html.defs.safe_attrs | set(['style'])). This will preserve style and at the same time protect from other unsafe attributes.