I see. Changing classes in postprocess_html works but css is still not applied. I have to add inline style myself:
Code:
def postprocess_html(self, soup, first_fetch):
for tag in soup.findAll(attrs={'class':re.compile('alignright')}):
tag['class'] = 'alignright'
tag['style'] = 'float: right; margin: 0px 0px 5px 10px;'
for tag in soup.findAll(attrs={'class':re.compile('alignleft')}):
tag['class'] = 'alignleft'
tag['style'] = 'float:left; margin-right:5px;'
for tag in soup.findAll(attrs={'class':re.compile('aligncenter')}):
tag['class'] = 'aligncenter'
tag['style'] = 'margin: 0px auto; display: block;'
return soup