In linea di principio ho risolto: faccio un ciclo che estrae dalla lista che contiene il codice HTML, gli applico la funzione renderContents() che butta i tag e tiene i contenuti e ricreo una lista "pulita".
Grazie di tutte le dritte! faber Il giorno 02 aprile 2010 11.35, Yuri <[email protected]> ha scritto: > Fabrizio Rota ha scritto: > > Con i vostri consigli e beautifulsoup ho scritto un external method che >> estrae da un pagina alcuni dati meteo. >> L'external method si chiama estrai_dati_meteo. >> Il risultato dello script dell'external method è una lista di dati meteo >> (!) come questa: >> >> [6.1 °C, 50 %, 1022.0 mbar, Est 112° 0.0 m/s (Raffiche 0.0 m/s), 0.0 mm >> Ultima ora, 2.5 mm Ultime 24 ore] >> >> Proprio ciò che mi serviva! >> >> Ora, sto scrivendo un page template che estrae alcuni dati da questa lista >> e li impagina opportunamente. >> Il problema è che se estraggo per esempio il primo elemento con il codice: >> >> <tal:block define="temperatura python:context.estrai_dati_meteo[1]"> >> > > come ti hanno fatto notare è: python:context.estrai_dati_meteo()[0] > > cmq, aggiungi anche un controllo (o al limite un tal:error) > > > <span tal:replace="temperatura">adfadfa</span> >> >> ottengo un bel >> Exception Type AttributeError >> Exception Value __getitem__ >> >> >> Qualche idea su come risolvere? La lista sembra così pulita.... perchè non >> tira fuori gli elementi? >> >> -- >> Faber >> -------------------- >> "Life is what happens to you while you're busy making other plans" - J. >> Lennon >> ------------------------------------------------------------------------ >> >> >> _______________________________________________ >> Plone-IT mailing list >> [email protected] >> http://lists.plone.org/mailman/listinfo/plone-it >> http://www.nabble.com/Plone---Italy-f21728.html >> > > > _______________________________________________ > Plone-IT mailing list > [email protected] > http://lists.plone.org/mailman/listinfo/plone-it > http://www.nabble.com/Plone---Italy-f21728.html > -- Fabrizio -------------------- "Life is what happens to you while you're busy making other plans" - J. Lennon
_______________________________________________ Plone-IT mailing list [email protected] http://lists.plone.org/mailman/listinfo/plone-it http://www.nabble.com/Plone---Italy-f21728.html
