Parse was breaking in the method clean_article_html when keep_article_html=True was used. On adding the import the problem was resolved