Use of HTMLparser to change language

Jeremiah Dodds jeremiah.dodds at gmail.com
Fri Mar 20 06:15:33 EDT 2009


On Fri, Mar 20, 2009 at 9:59 AM, pranav <pranny at gmail.com> wrote:

> Greetings All,
>
> I have huge number of HTML files, all in english. I also have their
> counterpart files in Spanish. The non english files have their look
> and feel a little different than their english counterpart.
>
> My task is to make sure that the English HTML files contain the
> Spanish text, with retaining the English look and feel.
>
> The most obvious and stupid way is to open the English and Spanish
> files in some HTML Editor. Look for the english text, see its
> counterpart in spanish and then replace it. (I don't know spanish, but
> as i said the look and feel is only little different, so i can easily
> guess which text is what + google translate).
>
> I am sure there is a python way of solving this problem.
>
> Can anyone help me out with some solution.
>
> Thanks,
>
> Pranny
> --
> http://mail.python.org/mailman/listinfo/python-list
>


If you have things like unique div ids for where the text is (and the ids
are the same, or you can make them the same), you could use something like
BeautifulSoup to replace the english stuff programatically.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090320/a0875f7d/attachment-0001.html>


More information about the Python-list mailing list