[Tutor] Editing html using python

Stefan Behnel stefan_ml at behnel.de
Mon Feb 15 13:53:52 CET 2010

Amit Sethi, 15.02.2010 13:28:
> Well ya I was kind of hoping to know about more tools and recommendations on
> how to edit broken html.

You already found lxml, don't think you can do any better. Note that you
shouldn't "edit broken html" but "fix broken HTML and then edit correct
HTML". Writing out broken HTML after editing it is likely not what you want.

> Their were tags that I wanted to replace using beautifulSoup
> however i saw that the replacewith function was not available for many of
> the tags I wanted to replace.

To understand your problem better, it would be helpful if you provided more
information, such as the names of the tags and a short example code snippet
that showed what you were trying to do.

> Also BeautifulSoup does not have unicode support.

Try to learn a tool before making blatantly false claims about it.

> So in a sense I did want recommendation perhaps I should have put my
> question in a better manner.

That's a very good idea. This will help:



More information about the Tutor mailing list