Ver Mensaje Individual
  #3 (permalink)  
Antiguo 03/10/2011, 10:05
Avatar de wolvelopez
wolvelopez
 
Fecha de Ingreso: junio-2008
Mensajes: 86
Antigüedad: 15 años, 10 meses
Puntos: 0
Respuesta: error de empty list con xmldom...

Cita:
Iniciado por razpeitia Ver Mensaje
Te recomendaría usar mas [URL="http://lxml.de/"]lxml[/URL] que el minidom de python.

Fuera de eso puedes hacer lo siguiente:
Código Python:
Ver original
  1. categoria_1 = nodo.getElementsByTagName("categoria_1")
  2. if(categoria_1 and categoria_1[0].childNodes):
  3.     print categoria_1.childNones[0].data

O también puedes usar excepciones.

Gracias pero probando ahora me salta este error:
print categoria_1.childNones.data
AttributeError: 'NodeList' object has no attribute 'childNones'

Muchas gracias por tu ayuda.