On Monday 12 April 2010, Fabrizio Rota wrote: > metodo esterno. > tx > faber
Dovrebbe bastare: # -*- coding: utf-8 -*- nelle prima riga (http://www.python.org/dev/peps/pep-0263/) > Il giorno 12 aprile 2010 18.20, Riccardo Lemmi <[email protected]> ha > > scritto: > > On Monday 12 April 2010, Fabrizio Rota wrote: > > > In uno script che usa beautifulsoup devo cercare il testo "Umidità " > > > > > > Con > > > umid_row = soup.find(text='Umidità :').findParent('tr') > > > > > > ho questo errore > > > > > > Exception TypeUnicodeDecodeErrorException Value'ascii' codec can't > > > decode byte 0xc3 in position 6: ordinal not in range(128) > > > > > > Cercando una scorciatoia ho provato con > > > umid_row = soup.find(text='Umidit\xc3\xa0:').findParent('tr') > > > > > > > > > ma ottengo lo stesso errore. > > > > > > Evidentemente da una parte usa la codifica ascii e dall'altra unicode, > > > ma non ne esco.... > > > > > > Aiutino? > > > > Usa una stringa unicode e dichiara nello script il codec che stai usando > > (python script, metodo esterno o modulo?) > > -- > > Riccardo Lemmi Email: [email protected] > > Reflab S.r.l. - Plone Design, Development and Consulting > > Phone: +39 349 4620820 http://www.reflab.it > > > > _______________________________________________ > > Plone-IT mailing list > > [email protected] > > http://lists.plone.org/mailman/listinfo/plone-it > > http://www.nabble.com/Plone---Italy-f21728.html -- Riccardo Lemmi Email: [email protected] Reflab S.r.l. - Plone Design, Development and Consulting Phone: +39 349 4620820 http://www.reflab.it
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Plone-IT mailing list [email protected] http://lists.plone.org/mailman/listinfo/plone-it http://www.nabble.com/Plone---Italy-f21728.html
