replacing words in HTML file luap777 at
Wed Apr 28 17:03:00 EDT 2010

On Apr 28, 8:02 am, james_027 <cai.hai... at> wrote:
> hi,
> Any idea how I can replace words in a html file? Meaning only the
> content will get replace while the html tags, javascript, & css are
> remain untouch.
> THanks,
> James

You might try cleaning the HTML with uTidy (http:// to make XHTML then using Beautiful Soup (http:// to process

If the number of files isn't that large and it's a one-time thing, you
might be just as well using search and replace on the directory and
previewing each replacement as you go....

More information about the Python-list mailing list