Html character entity conversion

2006-07-30 Thread [EMAIL PROTECTED]
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_tex

Re: Html character entity conversion

2006-07-30 Thread Claudio Grondi
[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 = Beautiful

Re: Html character entity conversion

2006-07-30 Thread danielx
[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 = BeautifulS

Re: Html character entity conversion

2006-07-30 Thread [EMAIL PROTECTED]
Claudio Grondi wrote: > [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" > > htm

Re: Html character entity conversion

2006-07-30 Thread [EMAIL PROTECTED]
danielx wrote: > [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.su

Re: Html character entity conversion

2006-07-30 Thread Marc 'BlackJack' Rintsch
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_

Re: Html character entity conversion

2006-07-30 Thread Claudio Grondi
[EMAIL PROTECTED] wrote: > Claudio Grondi wrote: > >>[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"]

Re: Html character entity conversion

2006-07-30 Thread John Machin
Claudio Grondi wrote: > [EMAIL PROTECTED] wrote: > > Claudio Grondi wrote: > > > >>[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

Re: Html character entity conversion

2006-07-30 Thread Claudio Grondi
John Machin wrote: > Claudio Grondi wrote: > >>[EMAIL PROTECTED] wrote: >> >>>Claudio Grondi wrote: >>> >>> [EMAIL PROTECTED] wrote: >Here is my script: > >from mechanize import * >from BeautifulSoup import * >import StringIO >b = Browser() >f =

Re: Html character entity conversion

2006-08-01 Thread Anthra Norell
Pak (or Andrei, whichever is your first name), My proposal below: - Original Message - From: <[EMAIL PROTECTED]> Newsgroups: comp.lang.python To: Sent: Sunday, July 30, 2006 8:52 PM Subject: Re: Html character entity conversion > danielx wrote: > > [EMAIL P

Re: Html character entity conversion

2006-08-01 Thread Claudio Grondi
Anthra Norell wrote: import SE# Available at the Cheese Shop I mean, that OP requested: 'How can I translate this using standard Python libraries??' so it's just only not on topic. Claudio Grondi -- http://mail.python.org/mailman/listinfo/python-list

Re: Html character entity conversion

2006-08-01 Thread Duncan Booth
[EMAIL PROTECTED] wrote: > How can I convert encoded string > > sEncodedHtmlText = 'привет > питон' > > into human readable: > > sDecodedHtmlText == 'привет питон' How about: >>> sEncodedHtmlText = 'text: приветпитоl 5;' >>> def unescape(m): return unichr(int(m.group(0)[2:-1]

Re: Html character entity conversion

2006-08-01 Thread Anthra Norell
- Original Message - From: "Claudio Grondi" <[EMAIL PROTECTED]> Newsgroups: comp.lang.python To: Sent: Tuesday, August 01, 2006 2:42 PM Subject: Re: Html character entity conversion > Anthra Norell wrote: > > >>>>import SE# Available at

Re: Html character entity conversion

2006-09-09 Thread yichun
[EMAIL PROTECTED] wrote: > danielx wrote: >> [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"] = "h