In <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] wrote:
> Here is my script:
>
> from mechanize import *
> from BeautifulSoup import *
> import StringIO
> b = Browser()
> f = b.open("http://www.translate.ru/text.asp?lang=ru")
> b.select_form(nr=0)
> b["source"] = "hello python"
> html = b.submit().get_data()
> soup = BeautifulSoup(html)
> print soup.find("span", id = "r_text").string
>
> OUTPUT:
> привет
> питон
> ----------
> In russian it looks like:
> "привет питон"
>
> How can I translate this using standard Python libraries??
Have you tried a more recent version of BeautifulSoup? IIRC current
versions always decode text to unicode objects before returning them.
Ciao,
Marc
--
http://mail.python.org/mailman/listinfo/python-list