I'm not sure what you are trying to accomplish. My guess is the problem is you're trying to keep a tag inside of another tag you are not keeping.
For example, say you have something like
Div Id=main
** *Div id=inner
** * * H1 xxxxx /h1
** */div
Div .... /div
/div
You can't just keep*H1, you need to keep the div id= main. In general, you want to keep the innermost container element that holds all the contents you want to keep, like [dict(id='main')], and use remove_tags to trim stuff you don't want.
|